|
-
May 5th, 1999, 08:13 AM
#1
Multithreading and UpdateAllViews in CDocument
Hi,
I have started a thread in my documentclass to watch modifications of files that I manage in the document. When the thread sees a change, my documentmember-function OnFileChange is called. In that function I want to display the changes in my views. And that's the problem : UpdateAllViews can't be called in the threadprocess.
Is there someone who has a good solution for this ?
-
May 5th, 1999, 08:39 AM
#2
Re: Multithreading and UpdateAllViews in CDocument
The thread can send a message to the mainframe, which can get the doc to update all views.
In thread:
AfxGetMainWnd()->SendMessage(WM_GETDOCTOUPDATEVIEWS);
In Mainframe:
CMainFrame::OngetDocToUpdateViews()
{
GetActiveDocument()->UpdateAllViews();
}
You will have to define WM_GETDOCTOUPDATEVIEWS your self and manually add is to the message map.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|