?
Solved

Debugg C++ ATL dll in C#

Posted on 2007-08-11
12
Medium Priority
?
1,176 Views
Last Modified: 2013-11-25
HI, I have created a C++ dll file using  "ATL project" template from VS2005.(unmanaged)
I have added reference to it in my C# solution, and simultaneously added the project inside.

The next step was importing the functions from the dll, which I used by making import dll atribute.
Now when I run the application, I can call methods from the dll but I can debug inside the dll.

Am I importing the dll or methods corectly, and why can't I debug the dll?
0
Comment
Question by:Dimkov
  • 7
  • 3
  • 2
12 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 19675961
Should well be possible, see http://msdn2.microsoft.com/en-us/library/fz5w87ad(vs.80).aspx ("How to: Debug Mixed-Mode Applications") - make sure to provide the symbol files of the ATL debug build.
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676026
the article says that it is just possible and gives sample how to speed up the process...

>make sure to provide the symbol files of the ATL debug build.
how to achieve this?

I put the output directory to be the bin folder of the c# project...is this enough?
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676033
while debugging while on the breakpoint it says:

The breakpoint will not be currently hit. No symbols have been loaded for this document

So i guess the solution doesn't have the symbol files. How can I include them?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 86

Expert Comment

by:jkr
ID: 19676044
Are the .pdb files present in that "bin" directory?
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676149
yes
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676456
I noticed that after setting reference, new additional dll is generated :
for Algoritam.dll generates Interop.AlgoritamLib.dll
when debugging, in modules window I try to load the symbols manualy, but since
it loads Interop.AlgoritamLib.dll, there is no pdb for it.

The project algorithm generates algorithm.dll, and by adding the reference in the C# project, the new file is generated without pdb for it...

any help pls...
0
 
LVL 86

Expert Comment

by:jkr
ID: 19676588
Hm, try leaving the .pdb files where they are and add their location to the symbol path: http://msdn2.microsoft.com/en-us/library/x54fht41(VS.80).aspx ("How to: Specify a Symbol Path")
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676710
i did that but it is not working.

Ok.. My dll has 5-6 functions.
All I am asked is that they are written in unmanaged C++.

I can use ActiveX, ATL, MFC dll... any...
I can create a new project from zero, but pls tell me the steps:
1. what kind of prioject to make
2. how to include it in the C# solution project in order to use its functions


0
 
LVL 4

Expert Comment

by:aponcealbuerne
ID: 19676829
hi, did you check the "Enable unmanaged code debugging" option in the properites of your project?
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676850
can you tell me where is it exacly? I cant find it
0
 
LVL 4

Accepted Solution

by:
aponcealbuerne earned 2000 total points
ID: 19676856
Are you using VS 2005?
right click in you project, the property page apear. then in "Debug" tab. and then in "Enable Debuggers" part.
0
 
LVL 3

Author Comment

by:Dimkov
ID: 19676870
God bless you
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 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