tlbimp creating incorrect assembly
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngmigrate' list.


Carey Loomis
-- This message, which was originally sent to "aspngconfig", has been moved to "aspngmigrate" mailing list by the List Master --

I'm using tlbimp.exe to create an assembly dll from a 3rd party COM object.
The import works fine with two exceptions:

1) One of the methods takes an optional parameter. After conversion, .NET
shows it as a required parameter.
2) One of the methods returns an instance of another class in the library.
After conversion, .NET shows this method as returning a type of 'object'
rather than the proper class type. If I try to cast the returned object to
the desired class, I get an invalid cast exception.

Anyone know how to get around this?
Thanks,
Carey

Reply to this message...
 
    
Martin & Leah Lacey

thats the way it works (for now, anyway)

create variables for the no-longer optional arguments.

cast the returned object to the interface (_MyInteropClass) where
MyInteropClass in the name of the class you expected it to return.

Use the object browser and inspect the Interop classes generated.

Martin.

-----Original Message-----
From: Carey Loomis [mailto:Click here to reveal e-mail address]
Sent: May 23, 2001 4:18 PM
To: aspngmigrate
Subject: [aspngmigrate] tlbimp creating incorrect assembly

-- This message, which was originally sent to "aspngconfig", has been moved
to "aspngmigrate" mailing list by the List Master --

I'm using tlbimp.exe to create an assembly dll from a 3rd party COM object.
The import works fine with two exceptions:

1) One of the methods takes an optional parameter. After conversion, .NET
shows it as a required parameter.
2) One of the methods returns an instance of another class in the library.
After conversion, .NET shows this method as returning a type of 'object'
rather than the proper class type. If I try to cast the returned object to
the desired class, I get an invalid cast exception.

Anyone know how to get around this?
Thanks,
Carey

| [aspngmigrate] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngmigrate.asp = JOIN/QUIT

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com