I have a C# program from which I am calling some functions/variables from C++.
The C++ program itself runs fine, and is checked. But, when I build this DLL and use it for C#, there is some bug in the interfacing code that is preventing me to get the correct result in C#.
Most probably, there is some error in export variables/exported functions giving out the results, which I want to check.
My primary question is : How do I debug this DLL, as in by putting breakpoints etc. and following along by seeing the results as we could do for any other program?
Assuming you have source code and debug symbols for the native (C++) DLL, you can check the “Enable unmanaged code debugging” option on the “Debug” tab of the managed (C#) EXE project, and then set breakpoints, inspect variables etc. in the C++ code as usual. You can add the C++ project to the solution, or just open a single C++ source code file and set breakpoints there.