Debugging a C++ DLL called from BlitzMax

BlitzMax Forums/BlitzMax Programming/Debugging a C++ DLL called from BlitzMax

JoshK(Posted 2011) [#1]
Is there any way to debug a DLL written in C++ with Visual Studio 2008, as it is being called from BlitzMax? All the BMX debugger tells me is the DLL functions that program crashes on. It would be very useful if there was a way to debug the C++ side of things as it is being called from BMX.


col(Posted 2011) [#2]
Hey Josh,

Never done it myself but it seems so...
Found this

Edit :- helps if I post the link!! lol.

Last edited 2011


col(Posted 2011) [#3]
Maybe you'll need the source though? or maybe some c++ code to call the bmx .exe


JoshK(Posted 2011) [#4]
I have the project and source for the C++ DLL.


skidracer(Posted 2011) [#5]
Load the dll project into visual studio, ensure target path is same as one Blitz prog is loading dll from, set some breakpoints in visual studio, run debug, set exe when asked to the BlitzMax program that is calling the dll and you're off.

Last edited 2011


JoshK(Posted 2011) [#6]
Does the DLL build path need to match the DLL that BMX loads, if they are identical? I have a post-build event that copies the built DLL into the BMX prog's directory, where it is loaded from.


skidracer(Posted 2011) [#7]
That should be fine. The trick is to "run" the dll from visual studio, and have it launch your BlitzMax exe for you.


JoshK(Posted 2011) [#8]
Thanks, it works! :D

Make sure you go to project Properties > Linker > Command Line and add "/DEBUG" in additional options.

Now I can catch crashes that occur when a BlitzMax program calls my C++ DLL!