Description: 1. First, the establishment of a basic dialogue exe project, and named the time 2. In the BOOL CTimeDlg:: OnInitDialog () function is the establishment of a timer, SetTimer (1,1000, NULL) 3. Then the establishment of the message to respond to classwizard function void CTimeDlg:: OnTimer (UINT nIDEvent), enter the code inside is as follows: Invalidate () 4. then classwizard set-up message response function void CTimeDlg:: OnDestroy (), enter the code inside the following: KillTimer (1) to this to eliminate the timer 5. void CTimeDlg:: OnPaint () where importation of the above algorithm 6. CtimeDlg class to add header file for the math.h, the code:# include " math.h" . 7. Compile, link and run.
File list (Check if you may need any files):
时钟.doc
clock\clock.aps
.....\clock.clw
.....\clock.cpp
.....\clock.dsp
.....\clock.dsw
.....\clock.h
.....\clock.ncb
.....\clock.opt
.....\clock.plg
.....\clock.rc
.....\clockDlg.cpp
.....\clockDlg.h
.....\Debug\clock.exe
.....\.....\clock.ilk
.....\.....\clock.obj
.....\.....\clock.pch
.....\.....\clock.pdb
.....\.....\clock.res
.....\.....\clockDlg.obj
.....\.....\Dlg.obj
.....\.....\StdAfx.obj
.....\.....\vc60.idb
.....\.....\vc60.pdb
.....\Dlg.cpp
.....\Dlg.h
.....\ReadMe.txt
.....\res\bitmap1.bmp
.....\...\bitmap2.bmp
.....\...\clock.ico
.....\...\clock.rc2
.....\resource.h
.....\StdAfx.cpp
.....\StdAfx.h
.....\Debug
.....\res
clock