c# include c++ and debugging

T

thomas

I have an c# exe-application which referenced a managed c++ dll.
The managed c++ dll is an wrapper for some unmanaged c++ classes in a
separate dll.

That works fine but I can't debug in the unmanged c++ dll.
Is there anyone who know why I can't debug in the unmanged c++ dll?
Or is ther any way to do this?

--- snip ---

e.g. managed c++ dll:

I can't debug in the method CppClass::Something().

#using <mscorlib.dll>
using namespace System

public __gc class CppWrapperClass
{
private:
CppClass m_class;
public.
void test()
{
m_class.Something();
}.
}

--- snip ---

Thanks in advance
Thomas
 
D

Dan Bass

Assuming your using Visual Studio .Net, I've seen two ways of doing this.
Got to Project -> properties then look for the Debugging in the left pane.

1. Project -> [project] Properties -> Configuration Properties ->
Debugging -> Enable Unmanaged Code [Set to True]

OR

2. If the first option doesn't exists, then there's an option for what code
to debug. The project settings will probably be set to debug "Auto". This
means it will detect whether the startup code is initially managed, or
native, and then only debug from there in that code type. IE. start up is
managed, only managed will be stepped through in that debug session, if
start up is native, then managed cannot be stepped through.
The setting can be change to Native, Managed, or Both as well. Select "Both"
and you should be sorted.

Thanks.

Dan.
 
T

thomas

Thanks, it works.
Cheers Thomas

Dan Bass said:
Assuming your using Visual Studio .Net, I've seen two ways of doing this.
Got to Project -> properties then look for the Debugging in the left pane.

1. Project -> [project] Properties -> Configuration Properties ->
Debugging -> Enable Unmanaged Code [Set to True]

OR

2. If the first option doesn't exists, then there's an option for what
code to debug. The project settings will probably be set to debug "Auto".
This means it will detect whether the startup code is initially managed,
or native, and then only debug from there in that code type. IE. start up
is managed, only managed will be stepped through in that debug session, if
start up is native, then managed cannot be stepped through.
The setting can be change to Native, Managed, or Both as well. Select
"Both" and you should be sorted.

Thanks.

Dan.

thomas said:
I have an c# exe-application which referenced a managed c++ dll.
The managed c++ dll is an wrapper for some unmanaged c++ classes in a
separate dll.

That works fine but I can't debug in the unmanged c++ dll.
Is there anyone who know why I can't debug in the unmanged c++ dll?
Or is ther any way to do this?

--- snip ---

e.g. managed c++ dll:

I can't debug in the method CppClass::Something().

#using <mscorlib.dll>
using namespace System

public __gc class CppWrapperClass
{
private:
CppClass m_class;
public.
void test()
{
m_class.Something();
}.
}

--- snip ---

Thanks in advance
Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top