New to mfc please help - Programmer

This is a discussion on New to mfc please help - Programmer ; Is it possible to load a CDialog from my application and display it without stopping the excution of a program. I have tried calling doModal from the initinstance function but this stops the rest of the program from executing. m_pMainWnd ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: New to mfc please help

  1. New to mfc please help

    Is it possible to load a CDialog from my application and display it
    without stopping the excution of a program. I have tried calling
    doModal from the initinstance function but this stops
    the rest of the program from executing.

    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    // process info

    I have also tried calling showwindow which works ok apart from
    the fact the the dialog is frozen on the screen when my program is doing
    its processing (run function). The dialog isn't repainted and there is
    no application present in the program bar at the bottom of the hpc
    screen.

    m_objDialog = new FDCSIAnywhereDlg();
    m_objDialog->Create(IDD_DIALOG_SYNC,NULL);
    m_objDialog->ShowWindow(WS_OVERLAPPEDWINDOW);
    m_objDialog->UpdateWindow();
    m_pMainWnd = m_objDialog;


    Regards,
    Clive


    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

  2. Re: New to mfc please help

    1 DoModal will start another message pump(CWnd::RunModalLoop) and can not
    return until the dialog is ended.
    2 check if WS_VISIBLE style is set for the modeless dialog.

    "Clive Moore" дʼ
    news:289bee3bd44d6e20888a2ae8b197fe74.35643@mygate .mailgate.org...
    > Is it possible to load a CDialog from my application and display it
    > without stopping the excution of a program. I have tried calling
    > doModal from the initinstance function but this stops
    > the rest of the program from executing.
    >
    > m_pMainWnd = &dlg;
    > int nResponse = dlg.DoModal();
    > // process info
    >
    > I have also tried calling showwindow which works ok apart from
    > the fact the the dialog is frozen on the screen when my program is doing
    > its processing (run function). The dialog isn't repainted and there is
    > no application present in the program bar at the bottom of the hpc
    > screen.
    >
    > m_objDialog = new FDCSIAnywhereDlg();
    > m_objDialog->Create(IDD_DIALOG_SYNC,NULL);
    > m_objDialog->ShowWindow(WS_OVERLAPPEDWINDOW);
    > m_objDialog->UpdateWindow();
    > m_pMainWnd = m_objDialog;
    >
    >
    > Regards,
    > Clive
    >
    >
    > --
    > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG




  3. Re: New to mfc please help

    Clive Moore wrote:

    > Is it possible to load a CDialog from my application and display it
    > without stopping the excution of a program. I have tried calling
    > doModal from the initinstance function but this stops
    > the rest of the program from executing.
    >
    > m_pMainWnd = &dlg;
    > int nResponse = dlg.DoModal();
    > // process info
    >
    > I have also tried calling showwindow which works ok apart from
    > the fact the the dialog is frozen on the screen when my program is doing
    > its processing (run function). The dialog isn't repainted and there is
    > no application present in the program bar at the bottom of the hpc
    > screen.


    Dialogs and other GUI features, including painting, can work normally
    only if your program returns frequently so it will continue to process
    windows messages.

    If you also want to do lengthy processing then you must put it in
    another thread. One thread remains responsive to windows messages, the
    other thread can execute without interfereing with the GUI. Use
    AfxBeginThread.

    --
    Scott McPhillips [VC++ MVP]


  4. Re: New to mfc please help

    WS_VISIBLE is set for the dialog and i call the create statement
    with no avail. Do I have to create an sdi application hide the
    main frame and then call a dialog?

    Is this posible?





    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

  5. Re: New to mfc please help

    m_objDialog->ShowWindow(WS_OVERLAPPEDWINDOW);
    parameter wrong
    "Clive Moore" дʼ
    news:f4e2c75b9cd1aa483f2ab413d6bc37d0.35643@mygate .mailgate.org...
    > WS_VISIBLE is set for the dialog and i call the create statement
    > with no avail. Do I have to create an sdi application hide the
    > main frame and then call a dialog?
    >
    > Is this posible?
    >
    >
    >
    >
    >
    > --
    > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG




+ Reply to Thread