Sign in to follow this  

Debugging a .DLL

This topic is 3782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, here's my situation: 1. I've got an executable that I made and it loads in .DLL's from a folder \AI in the same directory as itself. It also loads some other files ( art / sound ). This is not the project, just the straight release executable. c:\GAME\Game.exe c:\GAME\AI\MyDLL.dll c:\GAME\ART\Art.tga c:\GAME\SOUND\Sound.wav 2. I've got a project somewhere else where I'm actually creating the .DLL to put inside the \AI folder. When I compile in DEBUG mode, my newly created .DLL gets put in MyDLLProject\debug\MyDLL.dll. C:\MyDLLProject\debug\MyDLL.dll Ok, so I want to debug MyDLL.dll. How would I go about doing this? If I had the GAME project, I would simply open it up inside Visual Studio and copy over the newly created MyDLL.dll into the c:\GAME\AI\ folder and then step into the DLL through GAME project. However, since I don't have the GAME project ( I only have the final release executable ), I need to be able to debug through the MyDLL project. I can specify through the project properties to use the executable: "c:\GAME\Game.exe" and then I set the working directory to "c:\GAME". However, this doesn't seem to work correctly. How would I do this? I need to debug my DLL but yet I can't move my entire DLL project into the GAME directory in order for the DLL to be in the correct place. The reason that I need this to work without using the GAME project, is because I want to distribute the game to other people and allow them to create their own .DLL's for the AI. Obviously, at that point they will NOT have the GAME project, but just the release executable. Any help would be great! Thanks!

Share this post


Link to post
Share on other sites
If you don't need to debug in the first parts you can always attach to a running DLL.

Choose Debug->Processes, choose the game from your list and press attach. This should allow you to debug the DLL (you need to copy the debug DLL to the game folder of course).

Share this post


Link to post
Share on other sites
You can also change the output directory in the linker settings, so it'll output to c:\GAME\AI\MyDLL.dll, and then specify the game exe file for the process to debug when the compile finishes (You may have to tinker with the working directory setting in the project settings to get this to work).

Share this post


Link to post
Share on other sites
Create a solution that has the DLL project and the EXE project. The EXE can be set as the primary project. Then, just debug like normal. You'll be able to set breakpoints in the DLL code, etc.

Share this post


Link to post
Share on other sites

This topic is 3782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this