Checking of a file before the main window is shown
-
Sir, I am doing a file searching program before my appication shows its screen. If the file exists then the main window is shown otherwise an error is reported to the client. I know the code to be written will be in InitInstance but do not understand the exact place to write. Say..... if File Exists Show the Main window else Do not show the main window Report an error to the client. Regards Ykut Pls guide
-
Sir, I am doing a file searching program before my appication shows its screen. If the file exists then the main window is shown otherwise an error is reported to the client. I know the code to be written will be in InitInstance but do not understand the exact place to write. Say..... if File Exists Show the Main window else Do not show the main window Report an error to the client. Regards Ykut Pls guide
well, this seems to be pretty simple to me if i got that right: BOOL FindFile(void) { BOOL bResult; // ... return bResult; // return TRUE if your file's been found } // initinstance() if( FindFile() ) { CYourDialog dlg; if( dlg.DoModal() == IDOK ) // client clicked OK else // client clicked cancel } else { MessageBox(NULL, // your error msg... } ////////////////////////////////////////// i made a dialog-based app, for the sake of simplicity and clarity... hope this helps Я люблю русский языкь!