An HTML help 2 viewer with GoAsm source code. This viewer uses the IHx group of interfaces, which are largely undocumented to display, search and manipulate Help2 namespaces like the PSDK and MSDN. It is available on my website with source and executable. Comments and bug reports would be very welcome.

Help2 Viewer
Posted on 2009-02-23 23:29:07 by donkey
Rob Chandler, author of FAR and H2Viewer and Microsoft Help MVP has helped me out with the home page issue, I was not getting a home page for MSDN Express edition. He emailed me how he accomplished it in FAR and it solved the problem nicely, version has the GetHomePage function that is my attempt at implementing what he told me he did in H2Viewer. Essentially he first tries for the HomePage entry, if that's not found then the DefaultPage entry if that fails then he scans the table of contents to find the topmost url. I did not fully implement the scan of the TOC, I simply look at the first slot and if it contains a valid URL I use that, if not then I show a blank page.

Again, I would appreciate feedback on whether everything is working.
Posted on 2009-02-25 03:00:08 by donkey
Download your Source code to test the look .. but sometimes may crash .. do not know whether or because resources are not released due to other reasons .. Although the source code, but temporarily did not have time to read recently .. sorry
Posted on 2009-02-25 03:33:27 by Fido
Thanks Fido,

If you get a chance, a little more information would be helpful. What Windows version, does it crash on startup, what Help 2 namespace are you using etc.. would be most useful in tracking the bug. Since there are no docs for iHx, I can't be sure whether the interfaces that are opened by another interface are shut down by it so I am going through the code checking as best I can, for other types of esources (i.e. memory and gui) it should not be a problem.
Posted on 2009-02-25 07:03:29 by donkey
You have to love GoAsm,

Nearly 2000 lines of code and the ANSI to UNICODE transition took less than half an hour and everything was working, I am so happy I picked this assembler !!!

The UNICODE version has been uploaded ( there was an issue with the commctrl header file under UNICODE that has been dealt with, headers version 0x013002 is required to build the application because of the error, that has been uploaded as well. There is very little code changed since the change over from ANSI to UNICODE apis is automatically handled in the headers. The most significant difference is the lack of conversion back and forth, there were places where the lstrcpyn function was used when moving data from bstr return values to memory buffers. I decided on lstrcpyn because since I have no control over the length of string returned from the COM calls it protects the buffers from overruns. Any inline quoted text has the L modifier to indicate UNICODE, declared text uses DUS. The only real issue I ran into was the registry, you will have to delete the registry key created by the ANSI version and run the program to reselect it, it is found under


Just delete the whole thing, the namespace is the only thing saved there for now anyway.
Posted on 2009-02-25 13:35:23 by donkey
Error Messages on Help2 Viewer.exe
Posted on 2009-02-25 21:08:27 by dcskm4200
Hi dcskm4200,

What was the version number you tested, there were many errors that were taken care of in the last upload ( including a particularly nasty bug when changing namespaces. When was the error encountered ?

Posted on 2009-02-25 21:21:12 by donkey
thanks your responses.

last download (
When was the error encountered ?

Posted on 2009-02-25 21:34:37 by dcskm4200
Thanks dcskm4200,

I will look at the Dr Watson dump you posted and try to figure this one out. I hate Dr. Watson, it dumps itself as part of the stack and makes it difficult to trace back the last parameters pushed (then I can tell what the last call was). The error occured in Kernal32 and from the look of the stack was very early on, my guess is it was in the InitializeNamespace or LoadLastNamespace functions but I can't be sure until I take a closer look.

The latest version is, though that was uploaded only a short time ago and just has the minor change that adds the version number to the about box. It should not affect your issue.

Posted on 2009-02-25 22:14:02 by donkey
Hi dcskm4200,

I am still not having any luck reproducing the error here and the dump file isn't very helpful, is there any way you can trace the execution to find out where the fault is, no one else has reported any start up problems on this version so I don't hav anything to validate a bug against. That said, not many people bother to report bugs, they just leech the code and leave you hanging (little pun), I have started to think it isn't worth it to post code since there is almost no feedback anymore. I will keep trying to reproduce the failure.
Posted on 2009-02-26 18:31:08 by donkey
Didn't get to test this until now... Works fine on XP PRO SP2, Great feature the namespace thingy... I was worried that I would have to search through my quite messy tree of folders for any specific file but you handled it just fine :thumbsup:

Posted on 2009-02-26 19:22:41 by JimmyClif

Yes, Help2 uses registered namespaces, enumerating them was pretty simple once you figure out which interface to use. Help3 is supposed to be out very soon, the next release of VS is supposed to have a completely new (and documented ?) help system. Right now my major issue is to reverse engineer the CHM file format so I can extract an index and the topic URLs. I want to have a single help viewer for all the help files I have so I am busy with a hex editor and a couple of CHM files.

Posted on 2009-02-27 01:28:34 by donkey
I have added a table of contents to the viewer along with a synchronize button on the toolbar. In order to add the TOC I also had to add a tab control which should allow for better expandability in the future as I can now add new windows easily. I have yet to code the splitter bar, too many things going on with other parts of the program right now. I am currently working on adding the ability to open CHM files in the viewer and making the UI transparent to the difference. This will allow for a fully integrated help system for both HTML Help 1.x and 2.0 with complete transparency to the user.

The progress with HTMLHelp 1.x is slow, I have implemented the IStorage interface and can extract a Keyword index in XML format from any CHM file, the major outstanding issue is to parse the XML file. The TOC should be straight forward enough once I finish the parser. Once this is finished and implemented I will begin to scratch my head over the splitter bar and a few other UI issues.

You can download the source and executable at my website.

EDIT: The new version number is

EDIT: Uploaded, moved the search to the tab bar, hopefully fixed dcskm4200's bug
Posted on 2009-03-01 12:44:54 by donkey
Uploaded, moved the search to the tab bar, hopefully fixed dcskm4200's bug

still crashed.

maybe error here.
	// Get the available collections
invoke CoCreateInstance,offset CLSID_HxRegistryWalker, NULL, CLSCTX_ALL,offset IID_IHxRegistryWalker, offset pHxRegSession
CoInvoke(pHxRegSession,IHxRegistryWalker.RegisteredNamespaceList,,offset pIHxRegNamespaceList)
CoInvoke(pIHxRegNamespaceList,IHxRegNamespaceList.Count,offset nNamespaces)
mov ebx,
test ebx,ebx

Posted on 2009-03-01 18:57:39 by dcskm4200
Hi dcskm4200,

looks like it crashes on the call to IHxRegistryWalker.RegisteredNamespaceList, this is likely because HxRegistryWalker failed to instantiate, I will attach a copy here of the executable only, run it and if you could report the error that it returns. I am working under the assumption that you have at least one Help2 namespace installed on your system, either the PSDK or MSDN. At any rate I should have caught the error even if there are no namespaces installed (and hence no Hx functionality)


<attachment removed>
Posted on 2009-03-01 21:08:50 by donkey
Failed to find namespace error code = 80040154
could not find any help2 namespaces
Posted on 2009-03-01 21:27:14 by dcskm4200

Error 0x80040154 > Class not registered

The program cannot find the Hx classes that are installed with DExplore. DExplore is installed when you install either the PSDK or MSDN, you cannot view the Help2 files without these interfaces installed. Could you check to see if DExplore operates properly ? You are the only person to report a bug in the interface list part of the program so I am curious as to how DExplore can find the available namespaces without HxRegistryWalker.

DExplore can be found in the following path:

C:\Program Files\Common Files\Microsoft Shared\Help 9

Posted on 2009-03-01 21:37:14 by donkey

A few minor changes to the UI, the DISPID_COMMANDSTATECHANGE event is processed allowing the back and forward buttons to be disabled when there are no pages for them to navigate to. The top of the web browser has been aligned to the tab control and the search window resizing issue has been dealt with.

The initialization of the application had a bug where I assumed that any one running the app would have Help2 installed, that may not be the case so it will exit gracefully if the required class is not found. The OLE error code is reported in the termination dialog if the program cannot load Help2.

Posted on 2009-03-02 02:21:20 by donkey

Added a command line option to do an index search, this is primarily for integration into an IDE. The command line is very simple...

Help2 Viewer.exe /Keyword /Namespace

The keyword cannot contain spaces, nor can there be a space after the /. In order to make the program workable I also added a SingleInstance function, it enforces only one instance of the program to be running at a time. If another is started the command line is parsed and through some fancy interprocess communication it passes the keyword to the running instance. However, I am not entirely sure that Vista allows this type of thing so I need someone to test on Vista. Also the program needs to be run in Admin mode as far as I know, if someone can test that as well I would greatly appreciate it.

EDIT> I thought about the command line and added the /Namespace as well. The program will check to see if one was specified and initialize it if it is. The arguments are location specific, in other words the first argument must be the keyword. The namespace is as it appears in the select namespace dialog, that is :


Do not add the "ms-help://" prefix, it is added by the program.

Since this feature is aimed at IDE plugin authors I have decided the strictness is not a limitation so I will most likely not be changing it to a more robust method. It is up to the IDE to determine the fitness of the data passed.
Posted on 2009-03-03 16:58:01 by donkey

Had to redo the command line parser to parse it completely from within the application as there were issues with instances started through CreateProcess when lpApplicationName was non-NULL. It should now catch the problem and deal with it appropriately, I also added the option to change collections from an IDE, the command line syntax remains the same.
Posted on 2009-03-05 19:06:19 by donkey