Connecting Tech Pros Worldwide Forums | Help | Site Map

Working Directory Problem

qbproger@gmail.com
Guest
 
Posts: n/a
#1: Dec 2 '05
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?


Mihajlo Cvetanović
Guest
 
Posts: n/a
#2: Dec 3 '05

re: Working Directory Problem


qbproger@gmail.com wrote:[color=blue]
> 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.[/color]

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.
Joe
Guest
 
Posts: n/a
#3: Dec 3 '05

re: Working Directory Problem


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.

Carl Daniel [VC++ MVP]
Guest
 
Posts: n/a
#4: Dec 3 '05

re: Working Directory Problem


qbproger@gmail.com wrote:[color=blue]
> 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?[/color]

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


Joe
Guest
 
Posts: n/a
#5: Dec 8 '05

re: Working Directory Problem


I'm using Visual Studio .NET. Thanks a bunch.

Closed Thread