xCHM has been implemented by creating a wxWidgets virtual filesystem that recognizes the "file:example.chm#xchm:/page.html" format. I wrapped a C++ interface around the CHMLIB C API, and wrote code to extract the contents description and detect the document's main page. I've added a small HTML parser that extracts index and topic entries.
Since CHMLIB didn't provide it, I've had to implement fast search (when looking up a word, or part of a word, in all the pages in the .chm archive), based on the special $FIftiMain file. $FIftiMain is a representation of a search tree (B-tree) that, when used, yields logarithmic search times as opposed to a regular grep-like search. The fast index search could not have been written without Pabs' help, and in fact parts of the code have been 'borrowed' from his chmdeco project.
Sometime after version 1.0 I've added code that extracts the topic and index entries using binary data similar to $FIftiMain, which dramatically improved loading time for most .chms. The older method (parsing .hhc/.hhk files) is still in service, but only used as a fallback strategy.
If compiled with XMLRPC support, xCHM can be instructed to display specific topics while running with a loaded document. If you're interested in more details, please see the FAQ page.
If you would like to see the class hierarchy in more detail, you can look at it online here.
I assume there are probably some bugs left. I am much more interested in bug reports than feature requests.
Please point out the problem (and ideally the code section that needs attention) in bug reports. Whenever possible, provide the .chm file you were using when the problem occured.
xCHM can't handle:
- .chm files packing .mht files. The wxHtmlWindow component can only handle HTML pages.
- 'very proprietary' .chm files, making heavy use of MS-ITS:, mk:@MSITStore: links. The latter is not even supported by xCHM. So if you're trying to read Windows help files and can't quite make it, better just reboot / fire up your Windows VM and use hh.exe.