all groups > dotnet interop > april 2004 >
You're in the

dotnet interop

group:

Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466)


Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466) Naomi and Gad
4/30/2004 11:59:28 AM
dotnet interop:
I miserably fail using TlbImp.exe to create a .Net wrapper over a COM
object.
The COM object implements a coClass for an interface defined in an external
..tlb.
Say I implement class A for interface IA, when running TlbImp it reports
that it can't load type AClass from the assembly (there is no such class in
the COM .dll and no such was defined).
The problem was described in Microsoft as Q318466 (lookup KB318466 in MSDN).

I have the problem when running .Net 1.1 (it was reported referring to
VStudio 2002).
Is there is a fix, maybe you have it?
Is there a quick workaround?
Is there a source for an implementation of TlbImp that I could debug and
work over the failing part?
Is there a another implementation for creating the .Net wrapper over the COM
object, such that won't fail on this matter?

Thank you, Gad.


Re: Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466) Nick Wilton
4/30/2004 1:30:36 PM

Search for 'Platform Invoke' on msdn and use the instructions there to write
the .net wrapper yourself.
At least thats what I did and it seems to work

[quoted text, click to view]

Re: Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466) microsoft.public.dotnet.framework.interop
5/1/2004 12:22:50 AM
Are you reffering to consuming the functions from a COM object (as
described under smart devices project Platform Invoke Wrapper Example)
by defining its types in managed code and then calling them using the
DLLImport attribute?


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtu
v/html/etconplatforminvokewrapperexample.asp

Thank you, Gad.



*** Sent via Developersdex http://www.developersdex.com ***
Re: Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466) Nick Wilton
5/2/2004 8:17:16 PM
Yup, thats the stuff.

Hope it helps.


[quoted text, click to view]

AddThis Social Bookmark Button