Click here to Skip to main content
15,902,276 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIssues with modeless dialogs Pin
vipin_nvk26-Apr-12 21:43
vipin_nvk26-Apr-12 21:43 
QuestionRe: Issues with modeless dialogs Pin
Code-o-mat26-Apr-12 21:57
Code-o-mat26-Apr-12 21:57 
AnswerRe: Issues with modeless dialogs Pin
vipin_nvk26-Apr-12 22:24
vipin_nvk26-Apr-12 22:24 
GeneralRe: Issues with modeless dialogs Pin
Code-o-mat27-Apr-12 0:26
Code-o-mat27-Apr-12 0:26 
GeneralRe: Issues with modeless dialogs Pin
Albert Holguin27-Apr-12 9:01
professionalAlbert Holguin27-Apr-12 9:01 
AnswerRe: Issues with modeless dialogs Pin
Eytukan27-Apr-12 3:24
Eytukan27-Apr-12 3:24 
AnswerRe: Issues with modeless dialogs Pin
Albert Holguin27-Apr-12 8:59
professionalAlbert Holguin27-Apr-12 8:59 
Questionbuffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx26-Apr-12 10:23
professionaljkirkerx26-Apr-12 10:23 
I don't get it. It works fine in debug mode, but in release mode, this buffer I create doesn't seem to exist, and returns just nothing. At first I thought it was my wcsncpy_s, in which on ERROR_SUCCESS, I create the buffer, and copy the rgValue to szReturnValue instead of the wchar single copy for loop, but then I changed it to copy 1 wchar at a time and it does the same thing.

So in my message pump, I grab the data from the registry
case IDM_FILE_RECENTPROJECT_FILE1:				
{
CA_Registry caReg;					
WCHAR *szProject_Path = NULL;
DWORD dwProjectPath = 0;
				
caReg._read_Registry_ProjectMRUList_Value( L"File1", dwProjectPath );
szProject_Path = new WCHAR[ dwProjectPath + 1 ];
szProject_Path = caReg._read_Registry_ProjectMRUList_Value( L"File1", dwProjectPath );
					
_project_Open( szProject_Path );
					
delete [] szProject_Path;	

}
break;


And in the registry function, szReturnValue is there, but I can't check the value using the Add Watch or the mouse over, when running in release. All the other values show and I can check the values.



WCHAR	*szReturnValue = NULL;
WCHAR	*regPath = L"SOFTWARE\\redCopper\\Internet Commerce Engine 5\\ProjectMRUList\\";
	
HKEY	keyHandle;
WCHAR	rgValue[MAX_PATH]; 	
DWORD	dwValue = sizeof(rgValue);
DWORD	dwType = REG_SZ;
DWORD	regStatus = REG_DWORD;
					
if(RegOpenKeyEx(HKEY_CURRENT_USER, regPath, 0, KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS) {		
	regStatus = RegQueryValueEx( keyHandle, pzValue, NULL, &dwType, (LPBYTE)&rgValue, &dwValue );
	RegCloseKey(keyHandle);
		
	switch ( regStatus ) {
		case ERROR_SUCCESS:
		{
		if (( dwOut > 0 ) && ( dwOut < 4096 )) { 
		     szReturnValue = new WCHAR[ dwOut+1 ];
				
	             for ( DWORD dwI = 0; dwI <= dwOut; ++dwI ) {
		         szReturnValue[ dwI ] = rgValue[ dwI ];
		     }
		     szReturnValue[ dwOut ] = L'\0';

		}
		else {
		     szReturnValue = L'\0';
		     dwOut = wcslen( rgValue );
		}

	}
		break;

AnswerRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Big Daddy Farang26-Apr-12 12:27
Big Daddy Farang26-Apr-12 12:27 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx27-Apr-12 6:42
professionaljkirkerx27-Apr-12 6:42 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Randor 26-Apr-12 18:05
professional Randor 26-Apr-12 18:05 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx27-Apr-12 6:51
professionaljkirkerx27-Apr-12 6:51 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx3-May-12 12:55
professionaljkirkerx3-May-12 12:55 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Randor 4-May-12 2:54
professional Randor 4-May-12 2:54 
GeneralI thought that was ok to do Pin
jkirkerx4-May-12 5:30
professionaljkirkerx4-May-12 5:30 
GeneralRe: I thought that was ok to do Pin
Randor 4-May-12 9:45
professional Randor 4-May-12 9:45 
GeneralRe: I thought that was ok to do Pin
jkirkerx4-May-12 12:46
professionaljkirkerx4-May-12 12:46 
AnswerRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Richard MacCutchan26-Apr-12 22:22
mveRichard MacCutchan26-Apr-12 22:22 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx27-Apr-12 6:57
professionaljkirkerx27-Apr-12 6:57 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Richard MacCutchan27-Apr-12 22:57
mveRichard MacCutchan27-Apr-12 22:57 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx4-May-12 12:17
professionaljkirkerx4-May-12 12:17 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
Richard MacCutchan4-May-12 23:07
mveRichard MacCutchan4-May-12 23:07 
GeneralRe: buffer returning empty, doesn't exist on registry function when running in release, c++ win32 Pin
jkirkerx5-May-12 7:55
professionaljkirkerx5-May-12 7:55 
QuestionCalls to Vitual "overridable" of methods Pin
ForNow26-Apr-12 7:51
ForNow26-Apr-12 7:51 
AnswerRe: Calls to Vitual "overridable" of methods Pin
Albert Holguin26-Apr-12 8:15
professionalAlbert Holguin26-Apr-12 8:15 

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.