Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2007

Tip: Looking for answers? Try searching our database.

Breakpoints and Visual Studio 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Norman Diamond - 19 Sep 2007 05:38 GMT
One Visual Studio 2005 solution contains a C# project and C++ ATL DLL
project.  The DLL compiles fine, gets registered automatically, gets
referenced correctly when the C# program compiles, and gets called correctly
during execution.  So far, so good.

During execution of the DLL, a call to the ATL/MFC shared library method
CImage::Create returns FALSE.[*]  So I tried to set a breakpoint before the
call.

When not executing, Visual Studio displays a brown dot saying that the
breakpoint is valid.  When executing, Visual Studio displays a mostly
transparent dot with an exclamation mark saying that the breakpoint is not
valid.  I can right-click the dot and set an option for the "place" of the
breakpoint, but it doesn't matter.  The breakpoint never gets hit.

When I add and remove calls to the Win32 API MessageBox, they get executed
correctly.  So the DLL is getting recompiled properly and executed properly,
only the breaker is broken.

Does anyone know how to get breakpoints working?

[* I don't need help with this failure at this moment.  I only need help
with getting breakpoints working.]
SvenC - 19 Sep 2007 07:16 GMT
Hi Norman,

> One Visual Studio 2005 solution contains a C# project and C++ ATL DLL
> project.  The DLL compiles fine, gets registered automatically, gets
[quoted text clipped - 6 lines]
> valid.  I can right-click the dot and set an option for the "place" of the
> breakpoint, but it doesn't matter.  The breakpoint never gets hit.

Two things:
1) are you using debug builds?
2) did you enable mixed debugging for managed und unmanaged code?
Project->Properties->Debug "Enable unmanaged code debugging"

--
SvenC
Norman Diamond - 19 Sep 2007 09:06 GMT
> Hi Norman,
>
[quoted text clipped - 11 lines]
> Two things:
> 1) are you using debug builds?

Yes of course.

> 2) did you enable mixed debugging for managed und unmanaged code?
> Project->Properties->Debug "Enable unmanaged code debugging"

That was almost enough information to find it.  Thank you.  I know not to
shoot the messenger for this incredibly bad design, and I thank you for
informing me.

The solution has two projects in it.  Visual Studio's options, Tools -
Options - Debug, don't do anything to prevent debugging (I suppose they
could be set to prevent debugging but I didn't do so).  In the DLL's
properties, the debug options don't do anything to prevent debugging.  You
described an option which is available in the C# project's properties.  In
order to debug project #1, it's necessary to right-click project #2 and set
project #2's properties to enable debugging of project #1.  What an easily
discoverable (not) way to stop breakpoints from breaking in project #1.

Coming next:  To shut down your computer, don't click Start on your
computer, but click Start on your neighbour's computer.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.