I am trying to look at the registry on a WINNT machine. I have
the microsoft SDK loaded and am using it's lib and header files but can't seem to get the information I am expecting.
Here's my simple code that I expect should provide the same response as from a dos prompt "reg query HKLM\software\microsoft"
#include <iostream>
#include <stdlib.h>
#include <WINReg.H>
#include <Windows.h>
#include "main.h"
using namespace std;
HKEY usersKey;
char zsBuffer[1048];
signed long int *i;
DWORD j;
int len;
int main(int argc, char *argv[])
{
LONG cb = len;
j = RegQueryValue(HKEY_LOCAL_MACHINE, ("SOFTWARE\\Microsoft") ,zsBuffer,&cb);
cout << "buffer-" << zsBuffer << "-buffer " << (DWORD) j << " j" << endl;
system("PAUSE");
return 0;
}
the response I get is
buffer--buffer 0 j
Press any key to continue . . .
The 0 indicates The function completed successfully. (I believe)
Any help would be appreciated
the microsoft SDK loaded and am using it's lib and header files but can't seem to get the information I am expecting.
Here's my simple code that I expect should provide the same response as from a dos prompt "reg query HKLM\software\microsoft"
#include <iostream>
#include <stdlib.h>
#include <WINReg.H>
#include <Windows.h>
#include "main.h"
using namespace std;
HKEY usersKey;
char zsBuffer[1048];
signed long int *i;
DWORD j;
int len;
int main(int argc, char *argv[])
{
LONG cb = len;
j = RegQueryValue(HKEY_LOCAL_MACHINE, ("SOFTWARE\\Microsoft") ,zsBuffer,&cb);
cout << "buffer-" << zsBuffer << "-buffer " << (DWORD) j << " j" << endl;
system("PAUSE");
return 0;
}
the response I get is
buffer--buffer 0 j
Press any key to continue . . .
The 0 indicates The function completed successfully. (I believe)
Any help would be appreciated