How to debug an unmanaged dll?


O

Ole

In my Pocket PC solution I have C# project and an unmanaged C++ dll project
that is called by the C# project. The C++ project deploys the dll file to
the device when it has changed. What should I do to debug my dll - I have
set /ASSEMBLYDEBUG correctly but I still got the message "The breakpoint
will not currently be hit" at the breakpoints in the dll source??

Thanks
Ole
 
Ad

Advertisements

C

Christopher Fairbairn

Ole said:
In my Pocket PC solution I have C# project and an unmanaged C++ dll
project that is called by the C# project. The C++ project deploys the dll
file to the device when it has changed. What should I do to debug my dll -
I have set /ASSEMBLYDEBUG correctly but I still got the message "The
breakpoint will not currently be hit" at the breakpoints in the dll
source??

Hi,

Unlike on the desktop you can not debug both managed (C#) and unmanaged
(C++) source code at the same time within the smart device environment.

You have to switch between debugging the native and managed parts of your
code manually. You can do this via Visual Studio's "attach to process"
functionality.

This functionality needs to be enabled on your PDA before you can utilise
it. David Kline outlines the process in his blog posting available at
https://blogs.msdn.com/davidklinems/archive/2005/05/24/421566.aspx

MSDN also have some suitable articles surrounding this process:

Walkthrough: Debugging a Solution That Includes Both Managed and Native
Code - http://msdn2.microsoft.com/en-us/library/ms228818(VS.80).aspx

How To: Attach to Managed Debug Processes -
http://msdn2.microsoft.com/en-us/library/b1ksfbk7(VS.80).aspx

The walkthrough in particular will perhaps be helpful to you.

Hope this helps,
Christopher Fairbairn
 
Ad

Advertisements

F

Fabien

Hi,

You can try to add your native project to a solution with your C#
project. Then in the C++ project, click on properties, then debugging
tab, then in Remote Executable put the path of your managed
executable. Then click on Debug, Start new instance on the native
project.

BR

Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top