Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2004

Tip: Looking for answers? Try searching our database.

Debugging Interop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael J. Salamone [eMVP] - 22 Nov 2004 01:33 GMT
I have two COM Callable Wrappers created by tlbimp.

One of them I can create successfully in my C# application (CCWClass obj =
new CCWClass()).  The other, on call to new(), throws an exception - "the
parameter is invalid" - or ERROR_INVALID_PARAMETER.

If I go into disassembly mode, I see two calls.  I believe the first is the
call to new, and the second to the constructor.  It's on the call to new
that the exception is thrown.  For the other CCW, the new succeeds, and then
so does the constructor.

How do I go about debugging this?  Both wrappers are created identically.
Both added as references to the project.  Both interop assemblies are copied
to the bin\debug directory the app gets built into.  I don't see any
difference between how I'm creating them, adding them to the project, or
invoking them..

What strategies or tools exist for debugging this?

An aside:  asked this once, but didn't get an answer: is there a tool that
can take idl and spit a COM Callable Wrapper assembly?  I don't understand
why I have to run MIDL on the .idl to produce tlb, and then run tlbimp.
Seems unnecessary, PLUS the tlb doesn't necessarily have the necessary
information to correctly create the COM Callable Wrapper - whereas the idl
does.  So a much better job can be done of it by using idl as input as
opposed to tlb.  Anyway, hoping some tool exists.  Is there one?  If not,
perhaps a .NET Interop MVP can submit a request to MS for a tool like this.

Signature

Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com

Michael J. Salamone - 22 Nov 2004 05:19 GMT
Terminology mixup - substitue Runtime Callable Wrapper for COM Callable
Wrapper below....

Also a clarification to the disassembly referred to below.  It's the
disassembly for the line of code to create a new RCW (i.e. RCWClass rcw =
new RCWClass()).

Thx!

>I have two COM Callable Wrappers created by tlbimp.
>
[quoted text clipped - 24 lines]
> perhaps a .NET Interop MVP can submit a request to MS for a tool like
> this.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.