views:

38

answers:

1

I' 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 its rather hard to guess the correct types for everything since the interface hierarchy is quite deep

+1  A: 

You don't post a code example where you have a problem. Mostly it's depend on how you create or cast a object which you want to see in Debugger (create an instance of the object with new is always better, if it is possible of cause). 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 live can be easer (see http://blogs.msdn.com/b/habibh/archive/2009/09/22/debugging-a-com-object-runtime-callable-wrapper-with-visual-studio-2010.aspx).

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

http://stackoverflow.com/questions/1306262/inspecting-an-instance-of-a-com-interop-class-properly-in-vs-nets-debugger

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

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