The output from this only returns the letter 'C' in the path string.
Help!
Wizzsm.
std::string GetServiceConfig()
{
HKEY keyHandle;
char rgValue [1024];
LPCTSTR regPath = L"SYSTEM\\CurrentControlSet\\Services\\ApirbiService";
LPCTSTR regReq = L"ImagePath";
DWORD size1 = sizeof(rgValue);
DWORD Type;
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, regPath,0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
{
RegQueryValueEx( keyHandle, regReq, NULL, &Type, (LPBYTE)rgValue,&size1);
}
RegCloseKey(keyHandle);
std::string path(rgValue);
printf(" Binary path: %s\n", path);
return path;
}