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 / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

managed c++ and native c++ interop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 26 May 2004 17:09 GMT
Hello,

I am writing an application that relies heavily on interop between managed
c++ and native c++.

The main project is managed c++, but most of the classes themselves are
written in native c++ using the
"#pragma unmanaged" to prevent them from getting compiled into MSIL. A few
of the native classes do wrap
.NET framework components, and they use the gcroot<> template to hold
instances of the managed pointers.

The problem is debugging. Visual Studio is having a very hard time stepping
through my project. It constantly hangs and/or crashes. I have never had
problems like this before, and it seems to only be related to combining
managed c++ and native c++ classes in the same project.

Is anyone else out there having this problem? Can anyone from MSFT help me?
I'm at the point where I'm going to have to rip out all the managed code
from my project, and go back to pure native c++.

Thanks,

-Jim
Gary Chang - 27 May 2004 09:53 GMT
Hi Jim,

> The problem is debugging. Visual Studio is having a very hard time stepping
> through my project. It constantly hangs and/or crashes. I have never had
> problems like this before, and it seems to only be related to combining
> managed c++ and native c++ classes in the same project.

Which caused the hangs/crashes of your program's debugging process?

Does your program crash under release mode?

If it is the heavy work load of the debugging process causes your debugger
hang, it would be as expected; lots of the interop marshalling work across
the managed/unmanaged boundary will squeeze out the capability of the
debugger sometimes.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Jim - 02 Jun 2004 23:47 GMT
Thanks for your quick response Gary,

My program works find in both release and debug mode, it is only when I'm
stepping through it in the debugger that the problems occour.

"lots of the interop marshalling work across the managed/unmanaged boundary
will squeeze out the capability of the debugger sometimes"

I am running on a 3Ghz machine with a Gig of Ram. I understand that the
interop marshalling can be expensive, but I would think my machine could
handle it. When you say that lots of marshalling will squeeze out the
capability of the debugger, what exactly do you mean by "lots"? Are there
any papers or technical articles about this? It is very important for me to
be able to step through my code in the debugger, and I am very interested in
any known limitations of the debugger.

Thanks again!

-Jim

> Hi Jim,
>
[quoted text clipped - 23 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --------------------
Ronald Laeremans [MSFT] - 03 Jun 2004 00:31 GMT
Hi Jim,

There are know bugs in the debugger interop stepping code. The only thing in
general you can do it to try and avoid stepping over these points as much as
possible (e.g. by setting breakpoints rather than stepping).

Ronald Laeremans
Visual C++ team

> Thanks for your quick response Gary,
>
[quoted text clipped - 50 lines]
> rights.
>> --------------------
Gary Chang - 04 Jun 2004 04:41 GMT
Hi Jim,

Does Ronald's reply answer your question?
If you have more concerns on this topic, please feel free to reply this
message.

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

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.