Calling up a dialog from a dialog handler function

This is a discussion on Calling up a dialog from a dialog handler function within the Windows Programming forums, part of the Platform Specific Boards category; I have a dialog box that I called up from my WinMain function with DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc); In the ...

  1. #1
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100

    Calling up a dialog from a dialog handler function

    I have a dialog box that I called up from my WinMain function with DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);

    In the function DlgProc I want to call up another dialog box if a user clicks a certain button. How do I pass HINSTANCE from the DlgProc function?

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,167
    Is hInstance the hInst of your app? The one that's passed through the WinMain function? If so, then you can use GetModuleHandle. Also beware calling functions or starting new dialogs from your DlgProc since it will block any message processing.

  3. #3
    Registered User Welder's Avatar
    Join Date
    Oct 2007
    Location
    Washington
    Posts
    100
    Alright, thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  3. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  5. Using standard C fscanf function with win32 save dialog
    By korbitz in forum Windows Programming
    Replies: 1
    Last Post: 04-08-2004, 03:31 PM

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