Click here to Skip to main content
15,916,091 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: unicode to mbcs problem Pin
followait9-Jul-08 20:09
followait9-Jul-08 20:09 
GeneralRe: unicode to mbcs problem Pin
Stephen Hewitt9-Jul-08 20:11
Stephen Hewitt9-Jul-08 20:11 
QuestionProblem of Print Preview. Pin
Le@rner9-Jul-08 18:13
Le@rner9-Jul-08 18:13 
AnswerRe: Problem of Print Preview. Pin
Iain Clarke, Warrior Programmer10-Jul-08 0:06
Iain Clarke, Warrior Programmer10-Jul-08 0:06 
NewsLook for a friend Pin
halibobo9-Jul-08 17:52
halibobo9-Jul-08 17:52 
GeneralRe: Look for a friend [modified] Pin
_AnsHUMAN_ 9-Jul-08 18:52
_AnsHUMAN_ 9-Jul-08 18:52 
GeneralRe: Look for a friend Pin
halibobo9-Jul-08 20:54
halibobo9-Jul-08 20:54 
QuestionCrashing at RegQueryValueEx Pin
monsieur_jj9-Jul-08 16:00
monsieur_jj9-Jul-08 16:00 
Hi all,

I got this problem
DWORD dwData, Type, Size, dwRet, BufferSize;
	BufferSize = TOTALBYTES;
	PPERF_DATA_BLOCK PerfData = (PPERF_DATA_BLOCK) malloc( BufferSize );
	Size = BufferSize;

	lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, MPPARAM, REG_OPTION_NON_VOLATILE, 
			KEY_ALL_ACCESS,&Regentry);
			if (lResult == ERROR_SUCCESS) {
			dwRet = RMRegQueryValueEx(Regentry, _T(SERIALNO), NULL, &Type, (LPBYTE) &dwData, &Size);
				if( dwRet == ERROR_SUCCESS )
				{
					MPSerialNo = dwData;
					lResult =  RegOpenKeyEx(HKEY_LOCAL_MACHINE, MPSYSTEMKEY, REG_OPTION_NON_VOLATILE, 
					KEY_ALL_ACCESS,&Regentry);
						if (lResult == ERROR_SUCCESS) {
							dwRet = RMRegQueryValueEx(Regentry, _T(MAJORVER), NULL, &Type, (LPBYTE) &dwData, &Size);
							MPVerNo = dwData;
						}

				}
			}
		return;


My problem is that after the first RMRegQueryValueEx even if it is successful, dwData when passed its value to MPSerialNo which is an integer it crashes. MPSerialNo is first used here after declaration so therefore its value is some negative numbers then it becomes empty after the RMRegQueryValueEx.

Please advice

Thanks,
jayjay
AnswerRe: Crashing at RegQueryValueEx Pin
krmed10-Jul-08 2:14
krmed10-Jul-08 2:14 
QuestionC++ wrappers for C struct api Pin
Kishore Jonnalagadda9-Jul-08 15:14
Kishore Jonnalagadda9-Jul-08 15:14 
AnswerRe: C++ wrappers for C struct api Pin
Saurabh.Garg9-Jul-08 17:57
Saurabh.Garg9-Jul-08 17:57 
GeneralRe: C++ wrappers for C struct api Pin
Kishore Jonnalagadda9-Jul-08 18:25
Kishore Jonnalagadda9-Jul-08 18:25 
GeneralRe: C++ wrappers for C struct api Pin
Saurabh.Garg9-Jul-08 23:25
Saurabh.Garg9-Jul-08 23:25 
GeneralRe: C++ wrappers for C struct api Pin
Kishore Jonnalagadda10-Jul-08 0:11
Kishore Jonnalagadda10-Jul-08 0:11 
GeneralRe: C++ wrappers for C struct api Pin
Saurabh.Garg10-Jul-08 0:56
Saurabh.Garg10-Jul-08 0:56 
AnswerRe: C++ wrappers for C struct api Pin
BadKarma9-Jul-08 22:54
BadKarma9-Jul-08 22:54 
GeneralRe: C++ wrappers for C struct api Pin
Kishore Jonnalagadda9-Jul-08 23:54
Kishore Jonnalagadda9-Jul-08 23:54 
Questioncall a vbscript and get an output Pin
rocktx9-Jul-08 9:32
rocktx9-Jul-08 9:32 
AnswerRe: call a vbscript and get an output Pin
led mike9-Jul-08 10:10
led mike9-Jul-08 10:10 
QuestionGDI+ Region Outline question Pin
Iain Clarke, Warrior Programmer9-Jul-08 5:44
Iain Clarke, Warrior Programmer9-Jul-08 5:44 
AnswerRe: GDI+ Region Outline question Pin
Mark Salsbery9-Jul-08 6:21
Mark Salsbery9-Jul-08 6:21 
GeneralRe: GDI+ Region Outline question Pin
Iain Clarke, Warrior Programmer9-Jul-08 11:36
Iain Clarke, Warrior Programmer9-Jul-08 11:36 
QuestionRetriving the user privilage set using WINAPI Pin
vineeshV9-Jul-08 3:17
vineeshV9-Jul-08 3:17 
AnswerRe: Retriving the user privilage set using WINAPI Pin
Iain Clarke, Warrior Programmer9-Jul-08 4:47
Iain Clarke, Warrior Programmer9-Jul-08 4:47 
GeneralRe: Retriving the user privilage set using WINAPI Pin
David Crow9-Jul-08 5:03
David Crow9-Jul-08 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.