displaying two dialogs

This is a discussion on displaying two dialogs within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I'm trying to display the Login window and then when it closes the Chat window should be displayed. Instead ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    380

    displaying two dialogs

    Hi,
    I'm trying to display the Login window and then when it closes the Chat window should be displayed. Instead only the Chat window will display. This happens outside of the Borland IDE. The compiler that I'm using is Borland C++ 5.5.

    thank you

    Code:
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    	 LPSTR lpCmdLine, int nCmdShow)
    {
       int i;
       WNDCLASS wc;
    
       for(i = 0; i < 5; i++)
       {
         sprintf(users[i].username,"User %d",i+1);
         strcpy(users[i].emailaddress,"");
       }
    
     	DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(DIALOG_2),
    			NULL, (DLGPROC)LoginDialogProc, 0);
    
    	DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(DIALOG_1),
    			NULL, (DLGPROC)ChatDialogProc, 0);
    
    	return 0;
    }

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    Check the return from the first DialogBoxParam().
    If it's -1, call GetLastError() to fetch the errorcode

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 04-12-2009, 06:49 PM
  2. Ok..Tabbed dialogs...XP style
    By Joelito in forum Windows Programming
    Replies: 5
    Last Post: 05-14-2006, 03:36 PM
  3. I need to use dialogs as tabs?
    By BenPage in forum C++ Programming
    Replies: 1
    Last Post: 08-03-2005, 09:59 AM
  4. Modeless Dialogs in Multiple threads
    By MrGrieves in forum Windows Programming
    Replies: 0
    Last Post: 06-22-2004, 02:33 PM
  5. dialogs are easier, but what about the main window?
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 01-21-2003, 01:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21