CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    4

    How to create multitasking in the window?

    I use VC++ 5.0, MFC 4.21.

    I have a function, which archives a database and writes in the window resources. But, function does not give a focus to window to use controls (buttons etc.). Why or how to correctly program it?

    I use modalless dialog by:

    m_pArchivDlg->Create(IDD_ARCHIVEDIALOG);
    m_pArchivDlg->ShowWindow(SW_SHOW);
    m_pArchivDlg->UpdateWindow();

    ... and now continues long procedure, which using ODBC archives a database.
    I can change a static text by:
    m_pArchivDlg->m_StaticTable.SetWindowText(TEXT);
    but this is all!




  2. #2
    Join Date
    May 1999
    Posts
    8

    Re: How to create multitasking in the window?

    Hi,
    i guess by creating a separate worker thread for your database work may solve your problem, try to get help on AfxBeginThread().

    Thanks
    Chetan

    Nothing is imposible.

  3. #3
    Join Date
    May 1999
    Posts
    2

    Re: How to create multitasking in the window?

    i think it is maybe easier to put in your big loop some message dispatcher that will check for messages and post them to the window.. In that way you will be able to communicate with your dialog while he is processing the data..
    Sini



  4. #4
    Join Date
    May 1999
    Location
    PA
    Posts
    38

    Re: How to create multitasking in the window?

    Yap, if you can use PeekMessage or something similar to that and solve your problem then definitely this method should be the first choice over creating all together different thread as creating a thread is definitely an overhead.

    Chetan

    Practice makes the man perfect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured