Hi Lee,
The easyest way to achieve this is to declare an object of your dialog box derived class (e.g. CUserInfo, public CDialog) into the InitInstance method of the main application class.
Depending on the behavior you want you can place the code before dispatching the commands from command line (in which case the main frame of the SDI application will not be shown), or after, in which case the UserInfo dialog box will be shown over the main application window as modal.
The code snipped bellow can be more helpfull:
BOOL CSDIApp::InitInstance()
{
AfxEnableControlContainer();
....
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
//////////////////////////////////////
////////
//prompt user for data
CUserInfo dlg;
if (dlg.DoModal() == IDOK)
{
//do something here with the data
}
else
return FALSE;//i.e. quit the application if the user presses the 'Cancel' button
////////////////////////////////////////////
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
Hope this helps,
Silvius
Silvius Iancu