Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
Hi,
I have project in win32 and it creates one dialog include some Control tools.
 
When I using this function:
nRet = DialogBoxParam(hInst1, MAKEINTRESOURCE (IDD_DIALOG2), hWnd, LoginDlgProc1, 0);
 
It creates Dialog box and when using this function not creates:
HWND g_hDlg = CreateDialogParam(hInst1, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, LoginDlgProc1, 1);
 
Any problem with second function?
Regards,
Posted 22-Nov-12 6:42am
Rezame951
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Must use ShowWindow() function for that.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See this MSDN page[^], with particular reference to the difference between Modal and Modeless dialogs.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

As Richard and Rezame stated, the answer lies in modeless vs. modal window behavior. One of those calls creates a modal window that is by default shown, the other call creates a modeless window that is not necessarily shown by default (window exists but may be invisible).
  Permalink  

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

  Print Answers RSS
0 Peter Leow 375
1 Sergey Alexandrovich Kryukov 270
2 Zoltán Zörgő 258
3 CHill60 195
4 TheRealSteveJudge 180
0 Sergey Alexandrovich Kryukov 8,853
1 OriginalGriff 6,631
2 Peter Leow 4,102
3 Zoltán Zörgő 3,714
4 Kornfeld Eliyahu Peter 2,525


Advertise | Privacy | Mobile
Web02 | 2.8.150123.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2015
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