Link to home
Start Free TrialLog in
Avatar of ofritha
ofritha

asked on

File path

Hello all,
How do I get the absolute path to the current library?
I want to get the absolute path add it to the file I want to use.
Thanks,
ofrit
Avatar of iRBIs
iRBIs

Use ::GetModuleFileName(), and then cut off filename itself - you get the path
You mean Win32 dll module?

// Dll or application filename
char FileName[256];

GetModuleFileName( Handle, FileName, sizeof(FileName) - 1);
Avatar of ofritha

ASKER

Thanks iRBIs for your reply,
I did not understand how to use this method. In case my dll's name is LptDLL.dll how do I get its full path to use in the method LoadLibrary.
Thanks,
o
ASKER CERTIFIED SOLUTION
Avatar of iRBIs
iRBIs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ofritha

ASKER

Thanks for your help.
Ofrit