Debugging C++ DLL which is called from VB 
Author Message
 Debugging C++ DLL which is called from VB

I want to set a breakpoint in my C++ DLL.  It is being invoked from a VB
project.  Everything I try turns my little red dots (break points) into red
dots with white question marks in them.

The C++ project was ported from VC6.  So it has unmanaged classes. The port
ALSO brought over the old COM interface.  This is fine.  As I am working
with this now, I have several MANAGED PUBLIC WRAPPER CLASSES in a single
source file intended for .NET use.  These are such as "public __gc class
MyClass".  I am trying to set a breakpoint in methods of these managed
wrapper classes.

The VB project was developed stand alone, and solely to test the new wrapper
classes.  The VB project does NOT use the COM interface, but rather, the new
managed public classes.

The breakpoints I am working with are all located in the public managed C++
code.  I am running the first framework service pack.

Things I've tried:

Added the C++ DLL project to the VB project, with VB as the startup.

Added VB project to the C++ project, with VB as the startup.

Compiled them independently, and from the C++ project specified the VB EXE
as the startup, but in the debug output folder of the C++ project (i.e.
ensured the vb exe file was in the C++ project output folder).

All I get is red dots with white question marks, and no breaks are honored!

Please help!!!



Wed, 22 Jun 2005 02:11:35 GMT  
 Debugging C++ DLL which is called from VB
Is it possible to use DebugBreak()? I'm a newbie, but that might work.....


Quote:
> I want to set a breakpoint in my C++ DLL.  It is being invoked from a VB
> project.  Everything I try turns my little red dots (break points) into
red
> dots with white question marks in them.

> The C++ project was ported from VC6.  So it has unmanaged classes. The
port
> ALSO brought over the old COM interface.  This is fine.  As I am working
> with this now, I have several MANAGED PUBLIC WRAPPER CLASSES in a single
> source file intended for .NET use.  These are such as "public __gc class
> MyClass".  I am trying to set a breakpoint in methods of these managed
> wrapper classes.

> The VB project was developed stand alone, and solely to test the new
wrapper
> classes.  The VB project does NOT use the COM interface, but rather, the
new
> managed public classes.

> The breakpoints I am working with are all located in the public managed
C++
> code.  I am running the first framework service pack.

> Things I've tried:

> Added the C++ DLL project to the VB project, with VB as the startup.

> Added VB project to the C++ project, with VB as the startup.

> Compiled them independently, and from the C++ project specified the VB EXE
> as the startup, but in the debug output folder of the C++ project (i.e.
> ensured the vb exe file was in the C++ project output folder).

> All I get is red dots with white question marks, and no breaks are
honored!

> Please help!!!



Wed, 22 Jun 2005 07:17:47 GMT  
 Debugging C++ DLL which is called from VB
Wooo Hooo !

It sorta, kinda, almost sorta works!  But I can do a whole lot more
than before.
I think in .NET it is System::Diagnostics::De{*filter*}::Break() though.
Doesn't query me for attachment, as I expected, and always wants to
put disassembly on the screen (even for the managed code), but I can
do some examining, and instruction level stepping, which really helps.

I will definitely miss the ability to do this better, and more
straightforward
such as we did in VS6!!!

Thanks!

- Lee


Quote:
> Is it possible to use DebugBreak()? I'm a newbie, but that might
work.....



> > I want to set a breakpoint in my C++ DLL.  It is being invoked
from a VB
> > project.  Everything I try turns my little red dots (break points)
into
> red
> > dots with white question marks in them.

> > The C++ project was ported from VC6.  So it has unmanaged classes.
The
> port
> > ALSO brought over the old COM interface.  This is fine.  As I am
working
> > with this now, I have several MANAGED PUBLIC WRAPPER CLASSES in a
single
> > source file intended for .NET use.  These are such as "public __gc
class
> > MyClass".  I am trying to set a breakpoint in methods of these
managed
> > wrapper classes.

> > The VB project was developed stand alone, and solely to test the
new
> wrapper
> > classes.  The VB project does NOT use the COM interface, but
rather, the
> new
> > managed public classes.

> > The breakpoints I am working with are all located in the public
managed
> C++
> > code.  I am running the first framework service pack.

> > Things I've tried:

> > Added the C++ DLL project to the VB project, with VB as the
startup.

> > Added VB project to the C++ project, with VB as the startup.

> > Compiled them independently, and from the C++ project specified
the VB EXE
> > as the startup, but in the debug output folder of the C++ project
(i.e.
> > ensured the vb exe file was in the C++ project output folder).

> > All I get is red dots with white question marks, and no breaks are
> honored!

> > Please help!!!



Wed, 22 Jun 2005 07:50:43 GMT  
 Debugging C++ DLL which is called from VB
I guess you say it is managed C++ so this advice may be
moot, but just in case.

One can't step into any unmanaged C++ stuff unless
the "Debug Unmanaged" code option is checked.  To see this
option, right click on the VB project and choose
Properties and then go to the Debug section

Quote:
>-----Original Message-----
>I want to set a breakpoint in my C++ DLL.  It is being
invoked from a VB
>project.  Everything I try turns my little red dots

(break points) into red
Quote:
>dots with white question marks in them.

>The C++ project was ported from VC6.  So it has unmanaged
classes. The port
>ALSO brought over the old COM interface.  This is fine.  
As I am working
>with this now, I have several MANAGED PUBLIC WRAPPER
CLASSES in a single
>source file intended for .NET use.  These are such

as "public __gc class
Quote:
>MyClass".  I am trying to set a breakpoint in methods of
these managed
>wrapper classes.

>The VB project was developed stand alone, and solely to

test the new wrapper
Quote:
>classes.  The VB project does NOT use the COM interface,
but rather, the new
>managed public classes.

>The breakpoints I am working with are all located in the
public managed C++
>code.  I am running the first framework service pack.

>Things I've tried:

>Added the C++ DLL project to the VB project, with VB as
the startup.

>Added VB project to the C++ project, with VB as the
startup.

>Compiled them independently, and from the C++ project

specified the VB EXE

- Show quoted text -

Quote:
>as the startup, but in the debug output folder of the C++
project (i.e.
>ensured the vb exe file was in the C++ project output
folder).

>All I get is red dots with white question marks, and no
breaks are honored!

>Please help!!!

>.



Wed, 22 Jun 2005 13:24:32 GMT  
 Debugging C++ DLL which is called from VB
I managed to resolve this.  The VC6 ported project came into VS.NET without
the /Zi switch.  When I added it, all kinds of things started working,
including the ability to set breakpoints in managed code, and to step into
unmanaged code, and probably much more than this.  Also, I can see my source
code.  It is like taking the blinders off.

I have to wonder why the ported project came across this way, but I don't
really care at this point.  I will always look for this switch now when I
have this sort of problem in the future.

Best regards - Lee Gillie



Sat, 25 Jun 2005 01:08:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VB 5.0 calling C++ 5.0 DLL that calls winsock.dll

2. Debug VB.NET app and C++ DLL

3. Debugging C++ DLLs with VB exe

4. Calling a C++ DLL function which takes an C++ object as parameter

5. Debugging VB calls to Borland C DLLs (detailed)

6. Help with debugging DLLs called from VB

7. Debugging a 32bit DLL called from a VB app

8. debug DLL called from VB apps

9. Debugging VB dll sitting in COM+, called by ASP

10. call C++ dll in VB.net

11. Calling a C++ DLL using vb

12. Instability when calling a C++ DLL from VB.NET

 

 
Powered by phpBB® Forum Software