Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2008, 01:31 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Debugging DLL's

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.




 
Old April 23rd, 2008, 01:38 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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...-Hate-You.aspx
================================================== =========
 
Old April 23rd, 2008, 02:30 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old April 23rd, 2008, 02:32 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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...
 
Old April 23rd, 2008, 02:36 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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 ([u]P</u>roject|Refere[u]n</u>ces...), and in the dialog that appears, find the dll, and put a checkmark in the box next to it.
 
Old April 23rd, 2008, 02:41 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old April 23rd, 2008, 03:09 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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...-Hate-You.aspx
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
debugging activex dll's from asp problem Classic ASP Basics 0 March 28th, 2006 01:19 PM
probelms with dll's gabriel_ro BOOK: Beginning ASP 3.0 0 February 25th, 2005 07:30 AM
Registering DLL's askenkray Classic ASP Components 4 January 27th, 2005 03:05 PM
DLL's snowy0 VB.NET 1 October 1st, 2004 09:14 AM
VWD DLL's bmains ASP.NET 2.0 Basics 2 August 31st, 2004 06:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.