Hi guys,
I´ve got a problem with reading in the registry...
I want to look if the string of the following BTStatus is "1" or "0":
[HKEY_LOCAL_MACHINE\GoPal]
"BTStatus"="1"
If the BTStatus = 0 I want to do nothing...
So... my problem is, that I can´t test it here, because I am fixing a problem of a friend of mine...
I´ve got this code to read the string of a entry:
#include <windows.h>
#include <windowsx.h>
HKEY hkey;
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
{
CreateProcess(L"\\My Flash Disk\\Navigation\\mnavdce.exe\0",NULL,0,0,FALSE,0, 0, 0, NULL, NULL);
Sleep(5000);
DWORD dwData = 256;
BYTE cDaten[256] = "";
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"GoPal", 0, KEY_READ, &hkey)== ERROR_SUCCESS);
{
RegQueryValueEx(hkey, L"BTStatus",0,0,cDaten,&dwData);
if (cDaten == "1");
{
CreateProcess(L"\\My Flash Disk\\Bluetooth\\PhoneLink.exe\0",NULL,0,0,FALSE,0, 0, 0, NULL, NULL);
}
}
RegCloseKey(hkey);
return 0;
}
please... could someone have a look if something is wrong with it please?
I get an error-message while creating the Exe:
main.c(18): error #2168: Operands of == have incompatible types 'unsigned char *' and 'char *'.