Working Directory Problem

Q

qbproger

I'm developing a plugin for some software. The previous version of the
software didn't require a start in directory to be set. This allowed
me to leave the working directory to the default in the project. Now I
have to get my plugin working with the newer version of the software.
When I start the debugger with it aimed at that program and my program
installed, the program doesn't run properly unless I have the Working
Directory set to the same path as the start in directory for the
shortcut. I guess it uses that for some linking or something like
that, i'm not really sure.

Anyway, when i change the working directory for the program to work,
the debugger doesn't link properly so it's nor hitting any of my
breakpoints. If I don't set the working directory for the program it
doesn't work properly when i start it in the debugger and i can't load
my plugin.

Anyone know what files need to be moved or what has to be done for me
to have the working directory set to the program's director (as needed
for it to run) and have the debugger link properly so that I can get
debugging information as needed?
 
?

=?ISO-8859-2?Q?Mihajlo_Cvetanovi=E6?=

If I don't set the working directory for the program it
doesn't work properly when i start it in the debugger and i can't load
my plugin.

Though not what you were asking here's my 5 cents: make a plugin that
doesn't rely in any way on current directory. It can be done (in general
case), and it should be done.
 
J

Joe

The plugin doesn't rely on a specific directory. It has to be in a
specific directory in order to be run by the program though. It's MS
VS.NET that needs a specific directory for debugging information. But,
I figure there must be a way around that. That's why i'm here :-D

But yea, finding the debugging info after I change the working
directory is the problem.
 
C

Carl Daniel [VC++ MVP]

I'm developing a plugin for some software. The previous version of
the software didn't require a start in directory to be set. This
allowed me to leave the working directory to the default in the
project. Now I have to get my plugin working with the newer version
of the software. When I start the debugger with it aimed at that
program and my program installed, the program doesn't run properly
unless I have the Working Directory set to the same path as the start
in directory for the shortcut. I guess it uses that for some linking
or something like that, i'm not really sure.

Anyway, when i change the working directory for the program to work,
the debugger doesn't link properly so it's nor hitting any of my
breakpoints. If I don't set the working directory for the program it
doesn't work properly when i start it in the debugger and i can't load
my plugin.

Anyone know what files need to be moved or what has to be done for me
to have the working directory set to the program's director (as needed
for it to run) and have the debugger link properly so that I can get
debugging information as needed?

Typically the solution is to add a post-build step to your plug-in project
that copies the .DLL and .PDB files from your project's output directory to
the "plugins" directory of the host application.

If you don't know about post-build steps, reply back with the version of
visual C++ that you're using and I or someone else can help you get a
post-build step set up.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top