PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to debug an unmanaged dll?

Reply

How to debug an unmanaged dll?

 
Thread Tools Rate Thread
Old 12-11-2007, 09:00 AM   #1
Ole
Guest
 
Posts: n/a
Default How to debug an unmanaged dll?


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


  Reply With Quote
Old 12-11-2007, 11:17 PM   #2
Christopher Fairbairn
Guest
 
Posts: n/a
Default Re: How to debug an unmanaged dll?

"Ole" <ole@blabla.com> wrote in message
news:uX574pQJIHA.484@TK2MSFTNGP06.phx.gbl...
> 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.../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

  Reply With Quote
Old 13-11-2007, 07:35 AM   #3
Fabien
Guest
 
Posts: n/a
Default Re: How to debug an unmanaged dll?

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/


On 28 oct, 01:30, Thomas W <tho...@w.w> wrote:


On 13 nov, 00:17, "Christopher Fairbairn" <christop...@christec.co.nz>
wrote:
> "Ole" <o...@blabla.com> wrote in message
>
> news:uX574pQJIHA.484@TK2MSFTNGP06.phx.gbl...
>
> > 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 athttps://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



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off