Suppose that I have a dll called it MyDll.dll
It is in the d:\MyWorks\MyDll.dll [it is directshow dll]
I want to get path of its location from inside the MyDll code.
I used boost for this: FileSystem
string path = "";
boost::filesystem::path full_path( boost::filesystem::current_path() );
path = full_path.string();
But this give me its execution path, which is C:\Windows\system32, and not its location path which is d:\MyWorks\MyDll.dll.
How can I get a dll's location inside the same dll?
Update: By Get Module:
TCHAR path[2048];
GetModuleFileName( NULL, path, 2048 );
ostringstream file;
file << path ;
string const pathString =file.str();
cout << "Path: " << pathString << endl;
Gives me just hex-like string : 0049EA95....