Click to See Complete Forum and Search --> : Path during execution.


Darryl Adams
November 20th, 1998, 11:35 AM
I have what might be a simple question. I am new with VB, and I have

noticed that while running my App through the VB environment, the path is

set to the VB directory. However, the release App will have a different

initial path. (This comes into play with my DLL's. For the final app,

the EXE and the DLL will be in the same folder, so I would like to use

"MyDLL" as the lib, but while debugging I must use "C:\FullPath\MyDll.dll".)


So, Is there a way to tell the environment where to start the initial path?

Crazy D
November 23rd, 1998, 02:22 AM
You can use the path statement from good old dos to set it, but that's not needed.

When running apps in the IDE, the App.Path = the VB directory (although when you say Debug.Print App.path it might tell you the correct path).

When you've created an exe, the App.Path is the path where the exe is (e.g. C:\Program Files\MyProgram ), so there's no need to include a path in the lib-part of the declaration.

You can consider setting the dll in the system directory when you're debugging. If its not an ActiveX dll (and it sounds like it isn't), it doesn't matter where you put the dll as long as Windows can find it. So, if you set the dll in the system dir while debugging, you can declare the lib part as 'dllname.dll'. When the exe is finished, you don;t have to change your code -> just add the dll

in the same path as the exe.