2

I'm building an application using C# which will use CATIA COM modules. When I import the COM inside my C# project, I think that Visual C# Express generates the Interop automagically for me.

All of this works correctly. However, when I try to debug the application and use watches during runtime, every object is a System.__ComObject and I cannot get their "real" value.

Is there a way to tell the debugger the types of my COM objects?

The goal is to get more familiar with this new API I don't know really well. Sometimes it's rather hard to guess the correct types for everything since the interface hierarchy is quite deep.

2 Answers 2

3

You don't post a code example where you have a problem. Mostly it's depend on how you create or cast an object which you want to see in Debugger (create an instance of the object with new is always better, if it is possible of course). You should search for information about Runtime Callable Wrapper (RCW). This is "the guy" who can not understand what you want.

By the way if you can use Visual Studio 2010 your life can be easier (see Link).

Two links can help you to solve the problem if you use

http://dotnetdebug.net/category/com-interop/

http://resources.esri.com/help/9.3/arcgisengine/dotnet/e6532ba4-d769-48a6-8bc4-8592352b9bf4.htm

Inspecting an instance of a COM / Interop class properly in VS.Net's debugger?

http://dotnetdebug.net/2005/09/10/runtime-callable-wrapper-internals-and-common-pitfalls/

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot, I'll check this out monday while I get paid to do so =)
And it is better you give a simple overview once you get it done, for the convenience of other audience, Eric:)
0

In visual studio if you open tools >> Options and then debugging >> General make sure the option "Use managed compatibility mode" it checked on. This should show com objects as their proper types in the debugger.

1 Comment

"The managed compatibility mode option is deprecated and will be removed in future versions of Visual Studio."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.