Solved

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

Posted on 2006-11-07
5
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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 aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 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