Relative path and DLL 
Author Message
 Relative path and DLL

Hi,

Simple question : I have an ATL DLL (COM) which uses a standard DLL. My
files, in my developpement environement are organised like this :
<MyProjectPath>\Release(or Debug)\MyProject.dll
<MyProjectPath>\MyPath\somefile.xxx
<VC98Path>\lib\MyStandardDLL.dll
<SomePath>\test.exe

I use test.exe to run my DLL. In my DLL, I pass a relative path for
<somefile.xxx> to the dll MyStandardDLL.dll :
MyStandardDLLClass->MyStandardDLLMethod("MyPath\somefile.xxx").

It woks well inside VC++6.

Now, in a deployed environement, I'd like to have :
<DeployPath>\MyProject.dll
<DeployPath>\MyStandardDLL.dll
<DeployPath>\MyPath\somefile.xxx

It won't a be an exe file which will execute the DLL but an ASP page. And as
you can guess, it does not work properly. It would be nice if I could keep a
relative path to the file somefile.xxx. How can I do that ?

Thanks a lot for your help.

Fred



Fri, 29 Apr 2005 22:10:15 GMT  
 Relative path and DLL
Use GetModuleFileName to find out the full path to your DLL. Merge it
with the relative path you are given e.g. using PathCombine.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hi,

> Simple question : I have an ATL DLL (COM) which uses a standard DLL.
My
> files, in my developpement environement are organised like this :
> <MyProjectPath>\Release(or Debug)\MyProject.dll
> <MyProjectPath>\MyPath\somefile.xxx
> <VC98Path>\lib\MyStandardDLL.dll
> <SomePath>\test.exe

> I use test.exe to run my DLL. In my DLL, I pass a relative path for
> <somefile.xxx> to the dll MyStandardDLL.dll :
> MyStandardDLLClass->MyStandardDLLMethod("MyPath\somefile.xxx").

> It woks well inside VC++6.

> Now, in a deployed environement, I'd like to have :
> <DeployPath>\MyProject.dll
> <DeployPath>\MyStandardDLL.dll
> <DeployPath>\MyPath\somefile.xxx

> It won't a be an exe file which will execute the DLL but an ASP page.
And as
> you can guess, it does not work properly. It would be nice if I could
keep a
> relative path to the file somefile.xxx. How can I do that ?

> Thanks a lot for your help.

> Fred



Sat, 30 Apr 2005 01:13:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. finding full path from relative path

2. Absolute path to relative path?

3. relative path

4. Doing relative paths in ATL Server?!?

5. relative reference paths?

6. create a Uri from relative path?

7. Newbie - Relative file paths

8. absolute/relative path

9. convert absolute file path to relative

10. how to use relative paths with ATL components

11. Relative path in COFF

12. Relative Paths accorss projects

 

 
Powered by phpBB® Forum Software