1. In the void project, the image name is ondraw (CDC * PDC)
{Cretertrtrdoc * pdoc = getdocument (); assert_valid (pdoc); // todo: Add draw code for native data here CDC * pdc1 = getdc (); cstring strtime; ctime tTime = ctime: getcurrenttime (); strtime = tTime. format ("% Y-% m-% d % H: % m: % s"); // formatted as a string in the form of pdc1-> textout (100,100, strtime);} 2. Create the oninitialupdate () function. In the void project, the image name: oninitialupdate () {cview: oninitialupdate (); // todo: add your specialized code here and/or call the base class // do not write the object name settimer (, null) in the view;} 3. Due to settimer () the last function in the function is null. Call the void project of the ontimer () function. The image name is ontimer (uint nidevent) {// todo: add your message handler code here and/or call default CDC * PDC = getdc (); cstring strtime; ctime tTime = ctime: getcurrenttime (); strtime = tTime. format ("% Y-% m-% d % H: % m: % s"); // formatted as a string in the format of setdlgitemtext (idc_staticfilename, strtime ); PDC-> textout (100,100, strtime); cview: ontimer (nidevent );
}