?
Solved

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

Posted on 2006-11-07
5
Medium Priority
?
179 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 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