I have a service (lets say myservice) which tries to find out path of another application (lets say myapp.exe). myservice only knows about the name of application not the full path. my code is as follow:
HMODULE hModule = GetModuleHandle(TEXT("myapp.exe"));
if( hModule == NULL )
{
// error 126
return false;
}
int ret = GetModuleFileName(hModule, szBuffer, dwBufferSize);
if( !ret )
{
.......
return false;
}
GetModuleHandle always returns with 126 error mod_not_found. how can ! achieve this functionality.
Thanks, KM.