Registration Free COM errors with EXE

685 views Asked by At

I'm trying to use COM functions exposed by an EXE. I've created a C# project using Visual Studio 2010 (on a windows7/x64 machine) and added the reference to that EXE, then set the Isolated flag to true. When I build the solution, I get errors for each of the classes that it exposes.

Problem isolating COM reference 'FNCClient11Lib': Registry key 'HKEY_CURRENT_USER\SOFTWARE\CLASSES\CLSID{e49b30c9-6d7e-48f5-91da-f2f0414c6a13}\InProcServer32' is missing value '(Default)'.

These entries don't exist in the registry in that location but DO exist here (below)

HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID{E49B30C9-6D7E-48F5-91DA-F2F0414C6A13}

  • Is there any way I can point this to the right location in the registry when building?
  • Can I reference an EXE? All the examples I've seen so far reference DLLs only.
1

There are 1 answers

0
ekke On

This problem occurs when the type library contains classes that are marked as 'uncreatable' in the COM interface. You can check this by using the OLE/COM Viewer (as Admin), navigating to the type library that causes the problem, opening it and look up the CoClass definitions. If the one using the reported uuid is declared 'uncreatable', you got it. Also, in the VS object browser, these clases don't expose a constructor in the interface.

My solution was to rebuild the COM component with a public constructor for these classes but of course this is only possible if you have the sources.

Finally, there may be other reasons for this symptom though ...