A day or so ago I ran across a very frustrating bug that I feel compelled to post here to potentially save someone else the pain I went through.
Here’s the scenario:
- Install one of our legacy Win32 applications
- Install IE7
- Open the help–we use HTML Help (.chm files)
- Everything’s working great!
- Accept updates from the server (we have a custom auto-updater)
- After the application restarts, open the help
- Bam! The app crashes with an exception triggered from somewhere deep inside the ::HtmlHelp Win32 API call. (Please, no comments about the lack of exception handling here
)
None of that code had changed between the original install and the updated version! So what was the problem? It turns out that a component getting downloaded automatically as part of the update was including a Microsoft redistributable file to support Windows NT: PSAPI.dll (version 4.x) which IE7 is not compatible with.
After much googling (and yes, I mean using Google.com, Inc.) and other investigations (like one-by-one putting back DLLs to see if one of them was misbehaving for a reason I couldn’t comprehend), I came across this post in the newsgroups. Bingo! Because the help viewer was loading in our process (or at least from our process), IE’s working directory included the “bad” version of the dll. If I deleted the dll, things ran smoothly (including for our own application). In my case, that was my resolution–delete the file.
Fortunately that version of the file is pretty old so unless you’re explicitly supporting Windows NT, you should be safe relying on the version installed with the OS (found in %SYSTEMROOT%\system32).


Leave a comment