Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert valied strings into int? Pin
Christian Graus13-Nov-02 16:05
protectorChristian Graus13-Nov-02 16:05 
AnswerRe: how to convert valied strings into int? Pin
wabc13-Nov-02 15:46
wabc13-Nov-02 15:46 
Generalascii coded hex ! Pin
peter ho13-Nov-02 13:28
peter ho13-Nov-02 13:28 
GeneralRe: ascii coded hex ! Pin
Chris Losinger13-Nov-02 13:37
professionalChris Losinger13-Nov-02 13:37 
GeneralCTabCtrl problems Pin
Anonymous13-Nov-02 13:28
Anonymous13-Nov-02 13:28 
Generaltime&date formatting Pin
mariuszpopiolek13-Nov-02 12:42
mariuszpopiolek13-Nov-02 12:42 
GeneralRe: time&date formatting Pin
dabs13-Nov-02 13:03
dabs13-Nov-02 13:03 
GeneralError using GetOpenFileName in debug version, and not in release Pin
Mario M13-Nov-02 12:04
Mario M13-Nov-02 12:04 
Im trying this code in a dialog with only a button when you push it this code is executed:

void CBorradlgDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	OPENFILENAME ofn;       // common dialog box structure
	char szFile[512];       // buffer for file name
	char title[]="Title openfilename";
	// Initialize OPENFILENAME

	//ZeroMemory(&ofn, sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.hwndOwner = GetSafeHwnd();
	ofn.lpstrFile = szFile;
	ofn.nMaxFile = sizeof(szFile);
	ofn.lpstrFilter = "Object\0*.obj\0All\0*.*\0Text\0*.TXT\0";
	ofn.nFilterIndex = 1;
	ofn.lpstrFileTitle = NULL;
	ofn.nMaxFileTitle = 0;
	ofn.lpstrInitialDir = NULL;
	ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
	ofn.hInstance=0;
	ofn.lpstrCustomFilter=NULL;
	ofn.nMaxCustFilter=0; 
	ofn.lpstrTitle=(LPSTR)title; 
	ofn.nFileOffset=0; 
	ofn.nFileExtension=0; 
	ofn.lpstrDefExt=".obj"; 
	ofn.lCustData=0L; 
	ofn.lpfnHook=NULL; 
	ofn.lpTemplateName=NULL;

// Display the Open dialog box. 

	if(GetOpenFileName( &ofn ) != TRUE)
	{
		DWORD Errval=CommDlgExtendedError();
		switch(Errval)
		{
		case CDERR_DIALOGFAILURE:	AfxMessageBox("CDERR_DIALOGFAILURE "); break;
		case CDERR_FINDRESFAILURE: AfxMessageBox("CDERR_FINDRESFAILURE "); break;
		case CDERR_NOHINSTANCE: AfxMessageBox("CDERR_NOHINSTANCE "); break;
		case CDERR_INITIALIZATION: AfxMessageBox("CDERR_INITIALIZATION "); break;
		case CDERR_NOHOOK :AfxMessageBox("CDERR_NOHOOK "); break;
		case CDERR_LOCKRESFAILURE: AfxMessageBox("CDERR_LOCKRESFAILURE "); break;
		case CDERR_NOTEMPLATE: AfxMessageBox("CDERR_NOTEMPLATE "); break;
		case CDERR_LOADRESFAILURE: AfxMessageBox("CDERR_LOADRESFAILURE "); break;
		case CDERR_STRUCTSIZE: AfxMessageBox("CDERR_STRUCTSIZE "); break;
		case CDERR_LOADSTRFAILURE: AfxMessageBox("CDERR_LOADSTRFAILURE "); break;
		case FNERR_BUFFERTOOSMALL: AfxMessageBox("FNERR_BUFFERTOOSMALL "); break;
		case CDERR_MEMALLOCFAILURE: AfxMessageBox("CDERR_MEMALLOCFAILURE "); break;
		case FNERR_INVALIDFILENAME: AfxMessageBox("FNERR_INVALIDFILENAME "); break;
		case CDERR_MEMLOCKFAILURE: AfxMessageBox("CDERR_MEMLOCKFAILURE "); break;
		case FNERR_SUBCLASSFAILURE:AfxMessageBox("FNERR_SUBCLASSFAILURE "); break;
		}
	}	
}

Debug version throws CDERR_INITIALIZATION error Confused | :confused:
Release version works fine Smile | :)
where is the error?
Im using XP VC6 SP5

Thanks.
GeneralRe: Error using GetOpenFileName in debug version, and not in release- Solution Pin
Mario M13-Nov-02 17:40
Mario M13-Nov-02 17:40 
GeneralSubclassing.......heh heh heh Pin
nebbish13-Nov-02 11:58
nebbish13-Nov-02 11:58 
GeneralRe: Subclassing.......heh heh heh Pin
Joaquín M López Muñoz13-Nov-02 12:23
Joaquín M López Muñoz13-Nov-02 12:23 
Questionhow do you call updateallviews() from a dialog class? Pin
jack113-Nov-02 11:54
jack113-Nov-02 11:54 
AnswerRe: how do you call updateallviews() from a dialog class? Pin
valikac13-Nov-02 12:26
valikac13-Nov-02 12:26 
GeneralFrom primitive type to string Pin
S van Leent13-Nov-02 11:26
S van Leent13-Nov-02 11:26 
GeneralRe: From primitive type to string Pin
Joaquín M López Muñoz13-Nov-02 11:30
Joaquín M López Muñoz13-Nov-02 11:30 
GeneralRe: From primitive type to string Pin
S van Leent14-Nov-02 5:18
S van Leent14-Nov-02 5:18 
GeneralRe: From primitive type to string Pin
Joaquín M López Muñoz14-Nov-02 7:33
Joaquín M López Muñoz14-Nov-02 7:33 
GeneralRe: From primitive type to string Pin
S van Leent14-Nov-02 12:01
S van Leent14-Nov-02 12:01 
GeneralDo I need to delete a CArray Pin
Code4Food13-Nov-02 11:22
Code4Food13-Nov-02 11:22 
GeneralRe: Do I need to delete a CArray Pin
Joaquín M López Muñoz13-Nov-02 11:32
Joaquín M López Muñoz13-Nov-02 11:32 
GeneralRe: Do I need to delete a CArray Pin
Code4Food13-Nov-02 11:38
Code4Food13-Nov-02 11:38 
GeneralRe: Do I need to delete a CArray Pin
Joaquín M López Muñoz13-Nov-02 11:47
Joaquín M López Muñoz13-Nov-02 11:47 
GeneralRe: Do I need to delete a CArray Pin
Code4Food13-Nov-02 11:56
Code4Food13-Nov-02 11:56 
GeneralRe: Do I need to delete a CArray Pin
Christian Graus13-Nov-02 12:11
protectorChristian Graus13-Nov-02 12:11 
GeneralRe: Do I need to delete a CArray Pin
Joaquín M López Muñoz13-Nov-02 12:16
Joaquín M López Muñoz13-Nov-02 12:16 

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.