Wednesday, April 18, 2007

Fix: "Networking is not installed or properly configured"

I was running into a problem earlier today on a secondary Windows XP SP2 machine of mine at work where although the machine could browse the Internet successfully and could ping other machines on the local network, it could not connect to any file shares (shared folders) on other machines on the local domain. Other machines on the network could still browse file shares with no problem.

On the machine experiencing the problem, in the Computer Name tab of the System Properties dialog (brought up from Control Panel | System), the "Network ID" and "Change" buttons were disabled (grayed out). A message at the bottom of the dialog indicated that the reason for this was that "networking is not installed or properly configured".

I was able to fix the problem by removing and re-installing the machine's Client for Microsoft Networks, as follows:

  • From the Control Panel, open Network Connections.
  • Right-click on my active Local Area Network connection and choose Properties.
  • In the Local Area Connection Properties dialog, select Client for Microsoft Networks, then click Uninstall. Close the dialog and reboot when prompted.
  • After rebooting, bring up the Local Area Connection Properties again.
  • Re-install the Client for Microsoft Networks by clicking the Install button, selecting Client from the Select Network Component Type dialog, then selecting Client for Microsoft Networks from the Select Network Client dialog. Click OK all the way back out, then reboot the machine once more when prompted.

I don't know enough about the internals of Windows networking to understand *why* this solution worked to fix this problem in my case -- only that it did work! I share the steps I took here in hopes that they might be helpful to others as well (as a possible alternative to more extreme solutions such as re-installing Windows!).

(Please do consider carefully before following these steps; Client for Microsoft Networks is a critical Windows networking component, and removing it -- even with the intention of subsequently re-installing it -- could possibly have other adverse affects on a system. For example, if the re-install of the Client for Microsoft Networks were to fail for whatever reason, the machine could be left in a state where the machine's network connectivity is even further adversely affected.)

Monday, April 02, 2007

Using both "left" and "right" properties in a CSS style

I recently was working on a web page where I needed to draw a rectangle that would always be 50 pixels from the left edge of the browser window and 100 pixels from the right edge of the browser window, and which would stretch/shrink to maintain these criteria as the browser window was resized by the user. (Essentially, the rectangle would be "anchored" to both the left and right edges of the browser window.)

This rectangle would otherwise always appear on the same place on the page, and thus could be set to use the position:absolute style. Anchored Rectangle I decided to use a simple <div> tag set with a background-color CSS property to render the rectangle on the page.

To accomplish this, at first I was thinking I would need to catch the browser's window resize event, and call a Javascript function that would check the browser window's new width, subtract from that width the right "padding" for the rectangle (100 pixels in this case), and set the resulting figure as the new width for the rectangle.

Then I hit upon an alternative solution which wouldn't involve any scripting at all: I could simply set both the left and right CSS properties of the rectangle. The browser would be responsible for maintaining the rectangle's distance from the left edge of the browser window as well as the rectangle's distance from the right edge of the window, and thus script to resize the rectangle would not be necessary. The width property would not need to be specified at all, since the browser itself would calculate the width required to keep the rectangle the specified distances from the left and right browser window edges.

This works great in IE7 and Firefox 2. Unfortunately, it doesn't work in IE6. Apparently IE6 just does not support the specification of both left and right properties, or both top and bottom properties, of a CSS element. Instead, you need to specify one or the other plus width or height (as appropriate).

I did end up finding an approach that would work with IE6 and still only need a single line of CSS (at least for IE support). For IE, the CSS width property can be set using IE's proprietary "expression" syntax as in this snippet of CSS:

left:50px; width:expression((this.parentNode.offsetWidth - 150) + 'px')
This sets the width of the element to which the style is applied to the width of the parent element (the browser window, in the case of top-level elements), minus the specified value (150 in the above example), which should be set to the sum of the left property value and the effective value for the right property. In the above example, the style would cause the element to be offset 50px from the left edge of the browser window and 100px (150 - 50 = 100) from the right edge of the window. The width of the element gets recalculated on-the-fly as the browser window is resized.

Note that the "expression" syntax is IE-only, so as far as I know, it won't work in Firefox or other browsers. It does work ok in both IE6 and IE7.

Also, use of "expression" relies on Javascript being enabled; in the example above, if Javascript is disabled, the rectangle doesn't render on the screen at all.

Wednesday, March 28, 2007

Fix: Regsvr32 error "The specified module could not be found"

This morning, a tester to whom I had provided a COM .dll file with some extra logging to drop into his installation of one of our products reported to me that he was getting this error when trying to register the .dll on his machine using regsvr32: LoadLibrary([Filename.dll]) failed - The specified module could not be found. I re-checked, and the .dll file I had sent did register properly with regsvr32 on my own machine.

I investigated, and Google Groups helped me find the solution in a microsoft.public.win32.programmer.ole thread. The problem was the .dll file I had built was built in Visual C++ 6 in "debug" mode .dll; the "debug".dll (unbeknownst to me at thetime) had extra .dll dependencies which were present on my machine, but not on the tester's machine.

The solution was to build the .dll in "release" mode instead.

Google also turned up a helpful cryer.co.uk article which lists (1) "The name of the COM object is wrong" and (2) "The COM object requires another library which is missing" as possible causes of the "The specified module could not be found" regsvr32 error. The article suggests using the Sysinternals Filemon utility to determine which .dll file(s) are missing.

Tuesday, March 20, 2007

At Wit's End with Wii Wireless

A couple of weeks ago, I snagged a Nintendo Wii on a Sunday morning from a Target in my area that had gotten a shipment during the week and had released them for sale as their new ad flyer featuring the Wii came out that Sunday.

As I've previously posted, I have a Linksys BEFW11S4 wireless router, hardware revision version 4.

When I initially set up the Wii for wireless connectivity with the router, it worked like a charm. I was able to connect, and the various online functionality -- the store, news, weather, web browsing, and the "Everybody Votes" application -- all worked just fine.

However, the next day, the Wii reported that it was unable to connect to the Internet. I reset the router (by disconnecting it from wall power for a couple of seconds and then plugging it back in), and the Wii was once again able to connect successfully.

I knew to try resetting the router because I recognized the behavior as the same as what my TiVo has been exhibiting -- the TiVo will work normally for about a week, but then report that TV program data is low because it hasn't been able to successfully connect to the server, and I'll need to reset the router to get it to connect successfully again.

This problem hadn't been terribly annoying when just the TiVo was affected, since it wasn't too bad to just briefly pull the plug on the router once a week or so (since the TiVo is able to get TV program data for about a week in advance each time it connects). With the Wii, though, it will usually only go about half a day or so before it will lose the wireless connection and be unable to reconnect; this means that pretty much any time I want to use any of the online functionality of the Wii, I need to run upstairs to my office and pull the plug on the router first. And even then, the Wii takes longer than it should to display the news, since it didn't have a chance to download it in the background earlier while the system was idle via the "WiiConnect24" feature, and instead needs to download it on-the-fly. Annoying!

My desktop PCs, which are connected to the router via wired connections, aren't affected by this issue. Further, although I use my PDA's wireless connection functionality at home only infrequently, I've also never observed it be affected by the issue; the PDA seems to be able to connect with no trouble, even at times when the Wii won't connect.

The problem does seem to be with the router as opposed to with the Wii, since the TiVo is affected by the same problem.

It's a frustrating problem to troubleshoot, since each time I change a setting on my router to try and address the problem, I need to wait at least half a day before the Wii's connection will fail again (and thus establish that the attempted fix didn't work).

I've tried the following steps so far to fix the problem, one at a time; none have been successful so far:

  • Assigned the Wii a fixed IP address (and DHCP server IPs) rather than having it pick up an IP via DHCP.
  • Changed the broadcast channel of the router. (Tried channels 1, 2, 6, and 11).
  • Disabled the WEP security on the router. (Turned it back on afterwards after this didn't help.)
  • Disabled restriction of clients permitted to connect based on the client MAC address. (Re-enabled this after it didn't help.)
  • Reverted the firmware from 1.52.02 (the latest version) back to 1.50.14, after reading online about people having (unrelated) problems with the 1.52.02 firmware.
  • Changed the router's "Internet Connection Type" setting from "Connect on Demand" to "Keep Alive", thinking that maybe if my router's DHCP IP address lease from my ISP had expired, then the wireless connection from the Wii wasn't for whatever reason triggering the router to request a new IP, and that this setting change might trigger the router to always make sure that it had a current IP.
Unfortunately, none of these attempted solutions have had any impact on the problematic behavior. (After I applied the firmware version downgrade, I thought that might have done the trick since the Wii behaved itself for a little over a day after that, but the problem subsequently returned, just as before.)

I also haven't been able to find anything about this specific problem by searching around online. I've seen lots of posts about problems where people can't get the wireless connection to work at all, or where specific areas of functionality (like the online store) won't work, but no posts about this type of problem where the connection just seems to expire or time out after several hours.

At this point I feel like my best option to address the problem is to just pick up a new router, but I hesitate to throw $50 at the problem to fix it, since it really is just an annoyance.

If anyone knows of a fix for this issue, or even just has a suggestion for something else to try that might fix the problem, by all means please let me know! I'll update this post if I ever do come up with a solution for this issue.

Update 5/4/2007: Everything is working once again now! The Wii and the Tivo are now able to connect to the Internet over the wireless connection on a daily basis with no problem. So what did I change?

Nothing!... except that I left the BEFW11S4 router powered off for about 9 days straight while my family and I were away from home on vacation! When I returned and powered the router back up, everything started working fine. Prior to that, I had always had the router plugged in around the clock (except when I'd unplug it for a few seconds at a time to get the Wii and Tivo connectivity temporarily working again).

So if you're having this problem and have tried everything else, you could try unplugging your router for a while, perhaps overnight, or longer if you can get away with it. I'm not sure why this solution worked in my case -- maybe some hardware component in the router had overheated and needed some time unplugged to cool down? -- but I'm happy that things are working once again!

Thursday, March 01, 2007

Possible fix: IE7 won't show Favicon

I ran into a problem this morning where my install of Internet Explorer 7 was refusing to show the new favicon that I had dropped into the root directory of the website on my local IIS 5 installation for web pages hosted on the server. (Previously, the site had been running without any favicon.)

(A "favicon" is the icon image that gets displayed in the browser's address bar and as the bookmark icon, among other places, for websites that are designed to take advantage of that functionality. For example, the University of Michigan site uses a maize-and-blue "M" icon as the favicon. Note that in IE6, you need to bookmark a site and load that site back from the bookmark before the favicon will display in the address bar.)

Although all the reading I had done suggested that IE7 has full support for favicons, the new icon wasn't being displayed for any of the pages on my site; IE7 would instead just show the generic "IE document" icon. The icon did display correctly in Firefox, and also in another copy of IE on a different machine. Looking at the web server's IIS log, I could see that IE7 wasn't even attempting to request the favicon.ico file from the server.

I tried some simple workarounds to try and trigger IE7 to request the new icon, such as clearing IE's temporary internet files and re-bookmarking the web site, but didn't have any luck. And I could see that my IE7's support for favicons wasn't totally broken, as other sites in my bookmarks (favorites) list did still correctly display their favicons.

After spending a fair amount of time researching the problem across various websites and newsgroup postings, I finally came across a suggested workaround/solution at Wickham's XHTML & CSS tutorial (thanks Wickham!) that ended up fixing the problem for me. The workaround was to clear my IE7 browsing history. (Ctrl+H to bring up the History panel, then select each of the top-level items and delete them with the Delete key).

After clearing my IE history and closing and reopening the browser window, the favicon finally did display properly.

I'm unable to reproduce the issue now; my copy of IE7 is now correctly immediately picking up changes when I remove the favicon.ico file or drop a different favicon.ico into place, so I can't be certain that deleting the IE7 history (which admittedly seems like an odd solution) was what actually fixed the problem. Still, I'm posting this here in hopes that the workaround of clearing IE7's browsing history might be helpful to anyone else who is having a similar problem getting IE7 to properly show a particular website's favicon.

Update 3/7/2007: Jeff Davis ("jeffdav") from the Microsoft Internet Explorer team has posted to his blog a troubleshooting guide for favicons in IE7. It actually does mention clearing browsing history as a possible fix for favicons not showing up as expected. Go check it out if you're having trouble with favicons in IE7! (Thanks for the info, Jeff!)