Problem with Dialog

Discussion in 'MFC' started by paolob, Nov 11, 2006.

  1. paolob

    paolob New Member

    Joined:
    Nov 11, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,
    I got a SDI application, in the InitInstance i launch a dialog defined as below:
    Code:
    IDD_RACES_DIALOG DIALOG DISCARDABLE  0, 0, 327, 124
    STYLE WS_POPUP
    FONT 8, "MS Sans Serif"
    BEGIN
        DEFPUSHBUTTON   "",IDOK,3,5,11,11
        PUSHBUTTON      "",IDC_BTN_PLAY,46,80,34,19
        CONTROL         "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_BOTH |
    
                        TBS_NOTICKS | WS_TABSTOP,217,86,110,13
    END
    
    I want to add a command on MainFrame to bring the dialog on the foreground and I tryed a lot of ways (for example SetWindowPos, SetFocus, PostMessage(WM_LBUTTONDOWN), ...) but the app alwais raises a runtime assertion: ASSERT:):IsWindow(m_hWnd)).
    Is there a way to solve this problem?
    Thanks
    Paolo
     
  2. maddymoves

    maddymoves New Member

    Joined:
    Feb 25, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    :)
    U may go to InitInstance() method of APP class and insert the code as following steps.
    Create an instance for tat dialog.
    dialog_instance.DoModal();

    I think this will work.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice