Board index » cppbuilder » DLL - which location is it called from ??

DLL - which location is it called from ??


2005-09-28 11:38:55 AM
cppbuilder70
Hello all.
In my DLL code how can I find which directory it is located and being called
from by the calling app ??
Sure I can find the calling app using Application->ExeName but what of the
DLL itself ??
thanx in advance
david
 
 

Re:DLL - which location is it called from ??

"David" < XXXX@XXXXX.COM >wrote in message news:433a0fba$ XXXX@XXXXX.COM ...
Quote
Hello all.

In my DLL code how can I find which directory it is located and being called
from by the calling app ??
GetModuleFileName
Todd
 

Re:DLL - which location is it called from ??

"David" < XXXX@XXXXX.COM >wrote in message
Quote
In my DLL code how can I find which directory it is located
and being called from by the calling app ??
Use GetModuleFileName(), specifying the HINSTANCE that is passed in as a
parameter to your DllEntryPoint() function.
Gambit
 

{smallsort}

Re:DLL - which location is it called from ??

Yes this works a treat.
Thanks to both.
regards
david
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"David" < XXXX@XXXXX.COM >wrote in message
news:433a0fba$ XXXX@XXXXX.COM ...

>In my DLL code how can I find which directory it is located
>and being called from by the calling app ??

Use GetModuleFileName(), specifying the HINSTANCE that is passed in as a
parameter to your DllEntryPoint() function.


Gambit