I've got a bunch of C++ COM components that I'm adding to a C# .NET project as references.
All except one can be added successfully.
There is one that is never recognized as a COM.
It doesn't turn up in the COM tab in the Add Reference dialog.
So I forced to load it as a file but I get an error along the lines of:
"Please make sure the file is accessible and that it is a valid assembly or COM component."
The COM in question can be registered successfully using regsvr32 (checked registry to make sure it is there and it is).
However, when I come to add it as a COM reference, it is not recognized as a COM.
I compared this COM to all the other ones that got added successfully and of course there are differences but I can't think which of the differences is causing this one COM to not be recognized.
What am I missing?
Thanks in advance.
I stripped the COM down to its bones but still no luck.
However, investigation has revealed that:
-The GUID of the coclass is written to registry by regsvr32
-None of the GUIDs for the interfaces are written to registry
-However, GUIDs are correctly visible in OLE Viewer
-The registry entry for the coclass GUID is odd in that under InProcServer32 key, there are only the file location and threading model and no mention of InProcServer32
I'm guessing that because the interfaces are not written to the registry, I can't add it to my C# reference as a COM.
Any ideas how this happened?
How can I force regsvr32 to register the interfaces?