Simon Mourier

Hi,

Is there a any way to trace IUnknown::QueryInterface calls to a .NET implemented COM object I have read several articles on this subject, and can't find any useful information.

I found the notion of Customer Debug Probes here http://blogs.msdn.com/adam_nathan/archive/2003/05/13/56680.aspx, but there is no update for the Framework 2.0, and it does not seem to work. It does not seem to be officially documented.

Is CDP still supported Is there any other way

Thanks.




Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

nobugz

Try this Google query.





Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Simon Mourier

hmm... thanks nobugz, but this is not relevant to what I need, unless I am wrong

First, activeX/COM inspector is a tool and I am looking for programmatic support, and then, although this tool allows me to inspect an existing COM object (even .NET ones, and even its Events), it does not allow to trace lowlevel QueryInterface calls on it.






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Feng Chen - MSFT

Hi Simon,

For a .net implemented COM object, its IUnknown interface is exposed by the COM Collable Wrapper(CCW) which is a proxy class and expose the QueryInterface function called by the COM aware client. The CCW is actually dynamically created by the CLR.

As far as I know, you cannot trace the CCWs QueryInterface function in .net because the implementation of CCW is internal information and the CLR does not expose any interface of the class.

Maybe you can tell us what exactly you want or the problem block you in your application.

For more details, please visit: Shedding more light on the COM Interop wizardry.

Hope this helps!

Thanks!






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Simon Mourier

Hi,

I know how the COM interop works. What I am looking for is exactly the "Customer Debug Probes" feature described here http://blogs.msdn.com/adam_nathan/archive/2003/05/13/56680.aspx

It does not seem to work anymore, but I may be doing something wrong. I can't find any information on it. Is it still there Can it be enabled how is there another technique that replaces it etc...

Thanks.






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Feng Chen - MSFT

Hi Simon,

The Customer Debug Probes (CDP) enable you to find and diagnose difficult bugs lurking in managed code, even in a production environment. But the QueryInterface function is called by the unmanaged code of CLR itself. So you cannot use it on this issue.

Thanks!






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Simon Mourier

Hi,

Well, QueryInterface is originally called by the COM client, whoever that may be, not by the CLR execution engine that just transfers or transforms this call into a managed call. This COM client can be any COM code, written in any language.

One of the 11 Customer Debug Probes is specifically designed for tracing QI Calls. See here http://blogs.msdn.com/adam_nathan/archive/2003/09/12/56753.aspx

My original question is still valid. Is CDP still available working documented Or... Why is Adam Nathan not working on these subjects anymore

Thanks






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Feng Chen - MSFT

Hi Simon,

The .NET Framework 2.0 provides Managed Debug Assistants (MDA) for finding problems at run time in the code you've written. Think of MDAs as CDPs mature older sibling. For more details, please visit: High Availability: Keep Your Code Running with the Reliability Features of the .NET Framework.

Thanks!






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

nobugz

They are now called Managed Debugging Assistants and integrated into the IDE debugger. Debug + Exceptions, MDAs, click the Thrown checkbox for FailedQI. Is that actually what you're looking for





Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Simon Mourier

It sure sounds good!

Thanks






Re: Common Language Runtime Tracing QueryInterface calls on .NET implemented COM objects?

Simon Mourier

Hmm...

I have tried to use this, but it does not seem to work, although it sounds promissing. Is there anything special to do beside active this assistant