Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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
0
ofritha
Asked:
ofritha
  • 2
  • 2
1 Solution
 
iRBIsCommented:
Use ::GetModuleFileName(), and then cut off filename itself - you get the path
0
 
DemiurgCommented:
You mean Win32 dll module?

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

GetModuleFileName( Handle, FileName, sizeof(FileName) - 1);
0
 
ofrithaAuthor Commented:
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
0
 
iRBIsCommented:
GetModuleFileName() returns full path actually
0
 
ofrithaAuthor Commented:
Thanks for your help.
Ofrit
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now