Introduction - If you have any usage issues, please Google them yourself
I compiled a program similar to the performance monitor on Windows 2000. In this program, I created a document object and several views. The document object is responsible for collecting data regularly and notifying the associated views to display the data in different formats. The document object needs a time (time) event to collect data regularly. However, a document is not a windows-based object, so it has no such timing events. I weighed three solutions: 1. Create a timer in one of the views. Notifies the document object for data when the event occurs. 2. Create a separate thread for each document (or within each document) so that the thread can create time events regularly. I am not satisfied with the three methods of creating a timer in CMainFrame and calling the document function from it. Could a better solution be given?
Packet : 121114121doctime.rar filelist
DOCTIME\AppTimer.cpp
DOCTIME\AppTimer.h
DOCTIME\CmdTargList.cpp
DOCTIME\CmdTargList.h
DOCTIME\Doc.cpp
DOCTIME\Doc.h
DOCTIME\doctime.aps
DOCTIME\DocTime.cpp
DOCTIME\DocTime.dep
DOCTIME\DocTime.dsp
DOCTIME\DocTime.dsw
DOCTIME\DocTime.h
DOCTIME\DocTime.mak
DOCTIME\DocTime.ncb
DOCTIME\DocTime.opt
DOCTIME\DocTime.plg
DOCTIME\doctime.rc
DOCTIME\MainFrm.cpp
DOCTIME\MainFrm.h
DOCTIME\makefile
DOCTIME\RES\app.ico
DOCTIME\RES\APP.RC2
DOCTIME\RES\Doc.ico
DOCTIME\RES\Toolbar.bmp
DOCTIME\resource.h
DOCTIME\StatLink.cpp
DOCTIME\StatLink.h
DOCTIME\StdAfx.cpp
DOCTIME\StdAfx.h
DOCTIME\TraceWin.h
DOCTIME\View.cpp
DOCTIME\View.h
DOCTIME\RES
DOCTIME