hey everyone im making an gui in C++ which needs to retrieve windows registrys such as windows version etc. however im stuck on some code i was hoping for some help please.
void GetSystemInformation(void)
{
float fprocessor;
HKEY hKey;
DWORD processorspeed;
DWORD datasize;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Hardware\\Description\\System\\CentralProcessor\\0",0, KEY_QUERY_VALUE,&hKey);
RegQueryValueEx(hKey,("~MHz"),NULL,NULL,(LPBYTE)&processorspeed,&datasize);
fprocessor=float(processorspeed);
if (fprocessor>1000)
sprintf(processorspeed,"%3.1f Ghz",fprocessor/1000);
else
sprintf(processorspeed,"%3.1f Mhz",fprocessor);
}
that is my function however i get a error which is error C2664: 'sprintf' : cannot convert parameter 1 from 'DWORD' to 'char *' i cant find what the problem is cause the teacher said sprintf should get it to work and now i cant get in touch with my teacher so all help will be much apperciated. also if anyone knows a site which will help me get more sample code for any registry calls such as windows version,computer name etc can you please let me know thanks