Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC++
Dear friends,
i am sitting with win32 application in vc++ .i want to open a dialog box1 from dialog box2 by using a button in a dialog box2.i am waiting for your valuable answers.
Posted 2-Aug-12 3:17am
Comments
Wes Aday at 2-Aug-12 9:20am
   
To get "valuable answers" you have to ask a question first. What have you tried? Where is the code that demonstrates your problem?
Wes Aday at 2-Aug-12 9:38am
   
And this un-compilable code dump is supposed to ask a question? What exactly is the problem that you are having? And what is the code that you are using that demonstrates that problem?
Wes Aday at 3-Aug-12 7:02am
   
Okay so do it. Richard already told you what you need to do.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Add another dialog resource to your project and a handler for the button of your first dialog. In your handler call the second dialog. What is the problem exactly?
 
[edit]
In your dialog handler:
BOOL OnCommand(HWND		hDlg,		// handle to the dialog window
               int		nCmdId,		// ID value of the command entity (Menu or Accelerator)
               HWND		hWndCtl,	// HWND of control window
               UINT		codeNotify	// 0==Menu, 1==Accelerator
               )
{
    // Take action according to nCmdId
    switch (nCmdId)
    {
    case ID_xxx: // to call second dialgo
        DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG2), hDlg, (DLGPROC)Dlg2Handler);
        break;
 
// other command handlers ...

    default:
        // command not handled here
        return FALSE;
    }
 
    return TRUE;	// for all commands that have been handled
}
 
LRESULT CALLBACK DlgProc(HWND		hDlg,		// handle to the main dialog window
                         UINT		uMessage,	// windows message code value
                         WPARAM		wParam,		// parameter associated with the message
                         LPARAM		lParam		// parameter associated with the message
                         )
{
    switch (uMessage)
    {
    case WM_INITDIALOG:
        return OnInitDialog(hDlg, (HWND)wParam, lParam);
 
    case WM_COMMAND:
        return OnCommand(hDlg, LOWORD(wParam), (HWND)lParam, HIWORD(wParam));
 
    case WM_SYSCOMMAND:
        return OnSysCommand(hDlg, wParam, LOWORD(lParam), HIWORD(lParam));
    }
 
    return FALSE;
}
 

[/edit]
  Permalink  
v2
Comments
Richard MacCutchan at 3-Aug-12 8:45am
   
See above.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 474
1 OriginalGriff 388
2 Maciej Los 385
3 CPallini 194
4 CHill60 180
0 OriginalGriff 6,152
1 Sergey Alexandrovich Kryukov 5,312
2 Maciej Los 3,279
3 Peter Leow 3,184
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100