Can't get GetDllDirectory() to work?
Can't get GetDllDirectory() to work?
(OP)
Hi again,
Now that I can get my program to compile, I always get 0 returned from GetDllDirectory() and the string parameter is an empty string. When I do GetLastError() it reports "The operation completed successfully".
If I replace the GetDllDirectory() with GetModuleFileName(), it actually returns the whole path & filename of the executing program.
So:
1. Why is GetDllDirectory() returning 0 (meaning an error), but then GetLastError() says everything is fine?
2. Why am I getting back an empty string instead of something like "C:\Program Files\..."?
Now that I can get my program to compile, I always get 0 returned from GetDllDirectory() and the string parameter is an empty string. When I do GetLastError() it reports "The operation completed successfully".
If I replace the GetDllDirectory() with GetModuleFileName(), it actually returns the whole path & filename of the executing program.
So:
1. Why is GetDllDirectory() returning 0 (meaning an error), but then GetLastError() says everything is fine?
2. Why am I getting back an empty string instead of something like "C:\Program Files\..."?
RE: Can't get GetDllDirectory() to work?
RE: Can't get GetDllDirectory() to work?
Visual C++ 2003
RE: Can't get GetDllDirectory() to work?
In MSDN:
The GetDllDirectory function retrieves the application-specific portion of the search path used to locate DLLs for the application.
For detail.
Look for GetDllDirectory and SetDllDirectory in MSDN.
RE: Can't get GetDllDirectory() to work?