Hi, everyone, I need your help now.
I am writing a program with login check. What I really want is to present
a welcome box first with User_ID and User_Password input and then jump
to the main window after user passes the login check.
Following is the code I wrote so far in Borland's OWL, which always
generates the main window first and then displays a welcome box. I know
by executing TApplication::InitInstance() will display the main window.
Now my question is how to display a dialog box before the main window is
shown up on the screen? Displaying a dialog box needs a window's handle,
so before the main window is created, how do I handle the dialog box?
Thanks in advances!
Webb
------------------------------------------------------------------------
void myApp::InitInstance ()
{
TApplication::InitInstance();
if (TWelcomeDlg(GetMainWindow(), Transfer).Execute() ==
IDOK)
{
string info;
info += Transfer.UserID;
info += "\n";
info += Transfer.UserPassword;
info += "\n";
Transfer.UserID[0]=0;
Transfer.UserPassword[0]=0;
GetMainWindow()->MessageBox(info.c_str(),
"Login Results", MB_OK);
}
else
GetMainWindow()->CloseWindow();
--------------------------------------------------------------------------Quote:}