I’m developing a registered COM type library. When I build it, Visual Studio automatically registers the library. I can view the type library in OleView.
I have two branches of this library, in separate directories, which is causing the problem: the HELPDIR is pointing at the wrong branch. My registry looks like this:
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}]
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}\1.0]
@="My Type Library"
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}\1.0\0]
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}\1.0\0\win32]
@="c:\\path\\right_dir\\mylib.dll"
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}\1.0\FLAGS]
@="0"
[HKEY_CLASSES_ROOT\TypeLib\{6C964648-D0B3-4c8a-B7D5-53D176CBCC68}\1.0\HELPDIR]
@="c:\\path\\wrong_dir"
How do I get Visual Studio to correct the HELPDIR path when I build and register my library?
I used
regsvr32to unregister and then re-register the type library. When I unregistered, the registry keys were removed. Then when I registered again the correct values were added.