The ondraw () function in the SDI project view dynamically displays the system time

Source: Internet
Author: User
Tags textout
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 );

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.