Solved

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

Posted on 2006-11-07
5
174 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 4 160
Why don't I see this table in EDMX file? 2 23
C# replace string in void with dR["myData"].ToString() 3 40
Reset asp.net login password 4 29
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now