The htmlhelp (.chm) viewer uses special urls to display the pages inside the .chm with a normal internet explorer control. These URLs look like this: mk:@MSITStore:file.chm::/urlinsidechm
I want to do the same inside my own program which hosts an internet explorer control, and I managed to get it working. You can add these custom protocols by implementing IInternetProtocol(Root), see 'About Asynchronous Pluggable Protocols' in the platform SDK.
To make the system use your own protocol, you can add a registry entry which will work throughout the whole system (ie in every internet explorer running), this is called a permanent pluggable namespace handler. An alternative is the temporary pluggable namespace handler, which only works in your own process. This is the one I want.
To register a temporary handler, you use IInternetSession::RegisterNameSpace:

(from the PSDK)
HRESULT RegisterNameSpace(
IClassFactory* pCF,
REFCLSID rclsid,
LPCWSTR pwzProtocol,
ULONG cPatterns,
const LPCWSTR* ppwzPatterns,
DWORD dwReserved

My problem is the second parameter (rclsid), which is the class ID of your own handler. Is it possible to omit this parameter? The function wants both the class factory interface and a class id, which seems a bit redundant to me :confused:. I would like to keep the COM object inside my process, without registering it first.
A test without the classid (IID_NULL or just a random one) shows that it does work without a valid classid, but I don't think I can rely on that...

Posted on 2002-09-11 14:07:33 by Thomas