Need help displaying a dialog box before main window is displayed

Need help displaying a dialog box before main window is displayed

Post by Patrick B. Har » Mon, 18 Apr 1994 10:29:59



 I need her with a dialog bix I want to display before a user sees a main
window. I want the user to enter a name and a password before they can access
a program. I am using Borland C++ 4.0 and I would appreciate it if someone can
please e-mail me with help on how to diplay this dialog box and retrieve data
from it. I've managed to diaplay the dialog box which is begin called in
the InitMainWindow() function of my application derived from TApplication(), but
when I click on "OK", my program locks up. i don't understand. I tried to
override the CmOK() function provided by the TDialog class, but my program locks
up. I really need this feature in my program as it will also help me with other
parts of my program that I am working on. Thanks. I can be e-mailed at


TK

 
 
 

1. OWL question: display a login dialog box before main window shows

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();
--------------------------------------------------------------------------

2. FTP expert help

3. Displaying a second DIALOG BOX from another DIALOG BOX????

4. New VoIP Resource - VoIPWatch.com

5. keeping files open in Windows

6. Displaying a dialog box in Dialog-based MFC app

7. Sorting: address --> folder

8. How do I display a bitmap in a normal Windows 95 dialog box ?

9. Windows XP Dialog Box in C++ App Not Displayed Properly

10. Help: Button-less dialog boxes for displaying text?

11. Help needed in displaying strings in List Box