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.