|
Subject:
|
Debugging DLL's
|
|
Posted By:
|
amd2003
|
Post Date:
|
4/23/2008 1:31:35 PM
|
I created a COM dll in Visual C++ and a VB 6.0 EXE to execute the dll, as described in this tutorial:
http://www.codeproject.com/KB/atl/com_atl.aspx
I am interested in putting a breakpoint in the VC++ code, run the VB exe, and have the run stop at the breakpoint.
In C++, the did the following:
1. Put a breakpoint on a source line
2. Went to Project->Settings->Debug and entered the full pathname for the VB exe.
3. Built the Win32 Debug configuration of the dll
When I run the VB 6 exe, I hoped that the run would stop on my breakpoint but it didn't.
Any suggestions to make this happen?
Thanks.
|
|
Reply By:
|
gbianchi
|
Reply Date:
|
4/23/2008 1:38:47 PM
|
Hi there.. this apply to a dll builded with vb6, maybe it's the same??
1 - You run the dll project. 2 - In your main project (the exe) you add a reference to the dll (you will have a new dll with the name of the project you run in 1) 3 - you start your project, and when it reach a breackpoint, it will stop (in the dll)..
HTH
Gonzalo
=========================================================== Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html ^^Took that from dparsons signature and he Took that from planoie's profile =========================================================== My programs achieved a new certification (can you say the same?): WORKS ON MY MACHINE http://www.codinghorror.com/blog/archives/000818.html =========================================================== I know that CVS was evil, and now i got the proof: http://worsethanfailure.com/Articles/Classics-Week-I-Hate-You.aspx ===========================================================
|
|
Reply By:
|
amd2003
|
Reply Date:
|
4/23/2008 2:30:34 PM
|
Gonzalo,
Thanks for your quick reply.
> 1 - You run the dll project.
What exactly do I do? What does "run" mean?
> 2 - In your main project (the exe) you add a reference to the dll (you will have a new dll with the name of the project you run in 1)
Would this be a dsw or dsp? ---------------------------------------------------------- What I am doing is run the VB exe outside of the VB project.
Shaker
|
|
Reply By:
|
BrianWren
|
Reply Date:
|
4/23/2008 2:32:21 PM
|
I think breakpoints will only function for code that is running under the IDE. (I might be wrong about that.)
If that is true, you will need to open the DLL project in an IDE, and run it. While it is running, run the VB project in the IDE that uses the DLL. When the VB code causes the breakpoint to be hit, the code showing in the IDE holding the dll code will stop at the breakpoint.
I mean, if you think about it, when the breakpoint is hit, the point where things have stopped needs to be displayed. That takes an environment in which to display it...
|
|
Reply By:
|
BrianWren
|
Reply Date:
|
4/23/2008 2:36:05 PM
|
To run a project means to load it into the development environment, and use the menu selection to Run the project...
Adding a reference means to go to the references menu item (Project|References...), and in the dialog that appears, find the dll, and put a checkmark in the box next to it.
|
|
Reply By:
|
amd2003
|
Reply Date:
|
4/23/2008 2:41:59 PM
|
Gonzalo,
I think that I got it. Your instructions gave me the hint I needed.
1. On the C++ side, I hit Start Debugging->Go.
2. (It complained about my VB exe not having debug info.) I hit Continue. It hit my breakpoint.
Thanks.
Shaker
|
|
Reply By:
|
gbianchi
|
Reply Date:
|
4/23/2008 3:09:42 PM
|
Glad you work it out..
Brian explain it better than me anyway..
HTH
Gonzalo
=========================================================== Read this if you want to know how to get a correct reply for your question: http://www.catb.org/~esr/faqs/smart-questions.html ^^Took that from dparsons signature and he Took that from planoie's profile =========================================================== My programs achieved a new certification (can you say the same?): WORKS ON MY MACHINE http://www.codinghorror.com/blog/archives/000818.html =========================================================== I know that CVS was evil, and now i got the proof: http://worsethanfailure.com/Articles/Classics-Week-I-Hate-You.aspx ===========================================================
|