.NETGURU
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...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification