I have several ActiveX components that needed to be accessed from a C# project.
I can import them via Visual Studio\'s add reference dialog, which will also automati
Oh... found it after looking at the folder where TLBIMP belongs.
It's called AxImp
.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\AxImp.exe
So basically, to generate a PIA DLL in your own customized namespace:
Register your OCX
regsvr32 abc.ocx
Generate a strong name key pair for you ocx by running
sn -k
Run TLBIMP and specify the desired namespace
tlbimp abc.ocx /primary /keyfile:abc.snk /out:abc.dll /namespace:MyNamespace
Run AXIMP on the ocx and use the rcw
switch to use your own manully generated PIA DLL.
aximp abc.ocx /source /rcw:abc.dll
That should do it.
There are however some problems with ancient TLBs being imported. I am not sure how to fix that yet.