Creating 64-bit interop dlls from an ActiveX component  
Author Message
Ahsan Ali





PostPosted: 64-Bit .NET Framework Development., Creating 64-bit interop dlls from an ActiveX component Top

Hi there,

I have generated a 64-bit version of an old ActiveX component. I now need to create the appropriate interop dlls to be able to use this component from some managed code. Here's what I've tried:

> tlbimp myDll.ocx /out:myDllInterop.dll /machine:x64

This generates the error:
TlbImp : error TI0000 : A single valid machine type compatible with the input type library must be specified

From this error, it appears that I might not have a 64-bit activeX component. But when I check it using DependencyWalker, it says it IS a 64-bit dll. Is it possible that the typelib info inside the ocx is only 32-bits. If so, how can I verify that OleView doesn't give me enough info about the bit-ness of the tlb. And more importantly, how can I force a 64-bit typelib info to be embedded inside the ActiveX control

I've also tried aximp, but it doesn't seem to have any option to specify a target machine type at all

Do I have to write my own tlbimp/aximp using the TypeLibConverter class Can anyone point me in the right direction please
Thanks
Ahsan


.NET Development31  
 
 
MVP User





PostPosted: 64-Bit .NET Framework Development., Creating 64-bit interop dlls from an ActiveX component Top

...
Hi there,

I have generated a 64-bit version of an old ActiveX component. I now need to create the appropriate interop dlls to be able to use this component from some managed code. Here's what I've tried:

> tlbimp myDll.ocx /out:myDllInterop.dll /machine:x64

This generates the error:
TlbImp : error TI0000 : A single valid machine type compatible with the input type library must be specified

From this error, it appears that I might not have a 64-bit activeX component. But when I check it using DependencyWalker, it says it IS a 64-bit dll. Is it possible that the typelib info inside the ocx is only 32-bits. If so, how can I verify that OleView doesn't give me enough info about the bit-ness of the tlb. And more importantly, how can I force a 64-bit typelib info to be embedded inside the ActiveX control

I've also tried aximp, but it doesn't seem to have any option to specify a target machine type at all

Do I have to write my own tlbimp/aximp using the TypeLibConverter class Can anyone point me in the right direction please
Thanks
Ahsan
Are you sure you run the 64bit version of tlbimp
 
Willy.
 

 
 
Ahsan Ali





PostPosted: 64-Bit .NET Framework Development., Creating 64-bit interop dlls from an ActiveX component Top

Hi Willy,

I've tried both versions of tlbimp that are installed on my m/c
C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\bin\tlbimp.exe
C:\Program Files\Microsoft.Net\SDK\v2.0 64bit\Bin\tlbimp.exe

They both result in the same error message.
BTW, I'm running on XP x64 (in case it matters)
Thanks
Ahsan