By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,372 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,372 IT Pros & Developers. It's quick & easy.

Help! How to Debug into the DLL built in C++ from C#?

P: n/a
Dear Great Experts,

I have a problem and need your help!

We have a Flat DLL built in C++ (CCC), and on top of it, we built another
DLL built in C# (SSS), which has .Net Assembly. CCC was imported into SSS.

Now we build applications using SSS as a reference, and we found some
problems exist in CCC.
From our applicatyion, We can Debug into SSS, but cannot go further into CCC.
In your opinion, what is the best solution for us to debug into CCC?

Please tell me what is the best solution in your opinion!
Your help is highly appreciated! Thanks in advance!
--
Victor
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Victor,
I believe you can go into unmanged code if you set the correct property in
your C# project.

Right click on your project in the solution explorer tree, then go to
Configuration Properties -> Debugging and there is an option called "Enable
unmanaged debugging"

You should be able to put a breakpoint before you enter your C++ dll and
stpe into the code.

Hope that helps
Mark R Dawson.

"VicVic" wrote:
Dear Great Experts,

I have a problem and need your help!

We have a Flat DLL built in C++ (CCC), and on top of it, we built another
DLL built in C# (SSS), which has .Net Assembly. CCC was imported into SSS.

Now we build applications using SSS as a reference, and we found some
problems exist in CCC.
From our applicatyion, We can Debug into SSS, but cannot go further into CCC.
In your opinion, what is the best solution for us to debug into CCC?

Please tell me what is the best solution in your opinion!
Your help is highly appreciated! Thanks in advance!
--
Victor

Nov 17 '05 #2

P: n/a
Mark,

Thank you very much for your quick reply!
I followed your instruction, but still could NOT step into the souce code in
CCC.DLL.
For both my application project and the SSS.dll, i selected the option
"Enable unmanaged debugging" before compiled them.

when i debug to the place calling a API in CCC.dll (which is called inside
an API in SSS.dll), and tried to step into CCC's API, a window popped up and
gave the following message:
"There is no source code available for the current location."
(This window has 3 buttons "OK" "Show Disassembly" "Help".)

In SSS, we import CCC.dll by using:
private const string strDllPath = ".\\CCC.dll";

The calling relationship in our application is as follows:
OurApplication(C#)
|--->APIs in SSS.dll (C#)
|--->APIs in CCC.dll(C++)

Could you please tell me if i made any mistake? Can we debug into Flat DLL?
In order to debug into CCC, what is the best and quickest solution for me?
For the 3 layer calling relationship above, can we debug into the bottom
layer?
Do i need to merge my application with SSS.DLL and call APIs in CCC directly?
Or, forget about C# part, go back to C++ and build a new application just to
test APIs in CCC.dll directly?

I really appreciate your time and kind help! Thanks again!

Best wishes,

Victor
--------------------------------------------
"Mark R. Dawson" wrote:
Hi Victor,
I believe you can go into unmanged code if you set the correct property in
your C# project.

Right click on your project in the solution explorer tree, then go to
Configuration Properties -> Debugging and there is an option called "Enable
unmanaged debugging"

You should be able to put a breakpoint before you enter your C++ dll and
stpe into the code.

Hope that helps
Mark R Dawson.

"VicVic" wrote:
Dear Great Experts,

I have a problem and need your help!

We have a Flat DLL built in C++ (CCC), and on top of it, we built another
DLL built in C# (SSS), which has .Net Assembly. CCC was imported into SSS.

Now we build applications using SSS as a reference, and we found some
problems exist in CCC.
From our applicatyion, We can Debug into SSS, but cannot go further into CCC.
In your opinion, what is the best solution for us to debug into CCC?

Please tell me what is the best solution in your opinion!
Your help is highly appreciated! Thanks in advance!
--
Victor

Nov 17 '05 #3

P: n/a
Hi Victor,
what that error means I believe, is that there is no debug information for
your c++ code, you will need to build the C++ in visual studio and make sure
you have built it in debug mode.

As for your structure, there should be no reason why you can't debug from
Application -> CCC -> SSS

Mark.

"VicVic" wrote:
Mark,

Thank you very much for your quick reply!
I followed your instruction, but still could NOT step into the souce code in
CCC.DLL.
For both my application project and the SSS.dll, i selected the option
"Enable unmanaged debugging" before compiled them.

when i debug to the place calling a API in CCC.dll (which is called inside
an API in SSS.dll), and tried to step into CCC's API, a window popped up and
gave the following message:
"There is no source code available for the current location."
(This window has 3 buttons "OK" "Show Disassembly" "Help".)

In SSS, we import CCC.dll by using:
private const string strDllPath = ".\\CCC.dll";

The calling relationship in our application is as follows:
OurApplication(C#)
|--->APIs in SSS.dll (C#)
|--->APIs in CCC.dll(C++)

Could you please tell me if i made any mistake? Can we debug into Flat DLL?
In order to debug into CCC, what is the best and quickest solution for me?
For the 3 layer calling relationship above, can we debug into the bottom
layer?
Do i need to merge my application with SSS.DLL and call APIs in CCC directly?
Or, forget about C# part, go back to C++ and build a new application just to
test APIs in CCC.dll directly?

I really appreciate your time and kind help! Thanks again!

Best wishes,

Victor
--------------------------------------------
"Mark R. Dawson" wrote:
Hi Victor,
I believe you can go into unmanged code if you set the correct property in
your C# project.

Right click on your project in the solution explorer tree, then go to
Configuration Properties -> Debugging and there is an option called "Enable
unmanaged debugging"

You should be able to put a breakpoint before you enter your C++ dll and
stpe into the code.

Hope that helps
Mark R Dawson.

"VicVic" wrote:
Dear Great Experts,

I have a problem and need your help!

We have a Flat DLL built in C++ (CCC), and on top of it, we built another
DLL built in C# (SSS), which has .Net Assembly. CCC was imported into SSS.

Now we build applications using SSS as a reference, and we found some
problems exist in CCC.
From our applicatyion, We can Debug into SSS, but cannot go further into CCC.
In your opinion, what is the best solution for us to debug into CCC?

Please tell me what is the best solution in your opinion!
Your help is highly appreciated! Thanks in advance!
--
Victor

Nov 17 '05 #4

P: n/a
Mark,

Yes, it works!
Thank you very much for your help!
Best regards!
--
Victor
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.