LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging with DLLs

I have 2 projects loaded into my Labwindows workspace, a dll I have created and an executable to test the
exported function calls of the dll.  How can I step into the dll function code when I'm calling them from my
executable which is the Active prj.
 
I've tried generating a dbg dll and then running my executable to call the exported functions but this doesn't
work, also tried running the executable and setting the dll as the Active prj before executing the exported function
but this doesn't work either.
 
Thanks in advance,
 
 
Rick-In-Misery(Missouri)
 
 
0 Kudos
Message 1 of 3
(3,170 Views)
Hi Rick,
 
To debug your .DLL you would want to use breakpoints.  In order to do this make sure both your executable and your .DLL are in debug mode.  To set a breakpoint, go to the line of code in your executable that  contains the call to your debug .DLL.  From there, you can click on the left hand side of the code space where there is a vertical line separating your code space from a set of line numbers(if you have that particular feature active) or just a small blank white space (if you don't have vertical line number feature active). The breakpoint should be on the same line as the call to your .DLL.  Once you have this done, your application will halt at the breakpoint and you can use the 'Step Into' button on your toolbar to go into your .DLL function.
 
Good luck!
Message 2 of 3
(3,145 Views)
rtyson, you're very close to getting it working.  You need to specify the external process in your dll project to get it to work. 
We're going to tell LabWindows what application to launch when you press the Debug Project button.  Follow along:

  1. In your executable project, choose Build|Create Debuggable Executable
  2. In your dll project, select Run|Specify External Process...  
  3. In the dialog box that pops up, browse to the exe file created in step 1.
  4. Specify any command line arguments that you need.
  5. Press OK.
  6. Now place breakpoints throughout your dll code where you want to stop execution.
  7. Click on Debug Project.
You can read about it in the LabWindows help file.  Search for: Different Ways to Debug DLLs.
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
Message 3 of 3
(3,139 Views)