- Create a new .net class library project for the wrapper
- Declare the class as "ComVisible":
[ComVisible( true )] public class ClassName
- Generate the Keyfile:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\sn.exe -k "keyfile.snk"
- Set the project property to sign the library using the generated keyfile
- Generate the Registry entry with the path to the library .dll as the "codebase":
regasm.exe %TRGDIR%\LibName.dll /codebase
Specify also the /tlb option if the library is to be imported by the C++ #import directive
- Check the registry has the ProgId: LibName.ClassName and refers to the CLSID which has the "codebase" path to the LibName.dll
Friday, April 8, 2011
COM to .NET
How to make a .NET class library be accessible as a COM object?