Solved

How can I debug, step through a C++ DLL that I pinvkie?

Posted on 2006-11-07
5
176 Views
Last Modified: 2010-04-16
Hi, I'm getting that now source code is avialbe when I want to step into my C++ DLL that I pinvok in my C# application.  How can I so this?  I'm using vs2005, .net 2.0  Thanks.
0
Comment
Question by:lapucca
  • 3
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17896000
Open C++ Dll project, set C# client as executable for debugging: Project - Properties - Configuration Properties - Debugging - Command. Type here C# executable name. Set breakpoint in unmanaged function and select "Start Debugging".
0
 

Author Comment

by:lapucca
ID: 17900532
I followed your insstructions and the calling appl starts but I didn't stop at my breakpoin in the unmagaed code and I'm just getting the error message as if I'm just running the C# application directly.  What else can I check?  Thank you.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17900615
What error message? Are you sure that unmanaged function is called? If there is some interoperability problem, aplication can crash before unmanaged function is called.
To test this, add OutputDebugString call to the beginning of unmanaged function, and run with DebugView program:
http://www.microsoft.com/technet/sysinternals/utilities/DebugView.mspx
0
 

Author Comment

by:lapucca
ID: 17900649
It calls the  the unMaged function for sure.  I stepped through the c# application and got the same error message when the unmanaged function is called.  It doesn't crash the application.  The error message just says Login fail: unknown userid and password.  This is what I'm trying to locate in the unmanaged function as where is this happening.   The error message is put out from the unmanaged function definitely.  Thanks.
0
 

Author Comment

by:lapucca
ID: 17902055
I have no idea what I did but I am now able to step through the Unmanaged code from my C# application.  I swear that I wasn't able to do this last night and this morning.  Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question