Publish a text interface library. Release text display for several minutes. Make your dialog box or view text colorful.

Source: Internet
Author: User

 

 

Free text display for several minutes to make your dialog box or view text colorful


 

Liberation text display Processing

Do not waste your time on text display processing, and make your text display colorful in just a few minutes.

 

Example: a text message is displayed on the cstatic control of the dialog box:

 

 

Code:

Shuhuadll instructions:

In the dialog box, add the View:

In the dialog box, place a text control cstatic idc_static that carries the view.

Step 1: Hear the DLL header file in the header file of the dialog box

 

# Include "shuhuadll \ factory. H" // Add the view header file to the header file # include "shuhuadll \ shuhuavclass. H" // Add the view header file to the header file.

 

Step 2: Add member variables in the dialog box

    CFrameWnd * m_pFrame;      ShuhuaVClass* m_pView;  

Step 3: Add the following code to the oninitdialog () function initialized in the dialog box

Uint targetctrlid = idc_static; cwnd * pwnd = getdlgitem (targetctrlid); crect recttargetctrl; pwnd-> getwindowrect (recttargetctrl); pwnd-> destroywindow (); // get the idc_static screen rect this-> screentoclient (recttargetctrl); m_pview = Factory: getshuhuav (); // obtain the view pointer m_pframe = new cframewnd (); m_pframe-> Create (null, null, ws_visible | ws_child, recttargetctrl, this); If (null = m_pview) {return false ;} // initialize the view and set the displayed content m_pview-> createwindowshuhua (recttargetctrl, m_pframe); m_pview-> setwindowpos (recttargetctrl); m_pview-> setfile (L "Shuhua. XML "); // Shuhua. XML is located in the res \ folder and changes the content to its m_pview-> Init ();

 

Step 4: destroy the view in the Destructor or destroy function of the dialog box.

 

Factory::Destory ();  

 

Demo; www.gudianxiaoshuo.com

 

Publish a text interface library. Release text display for several minutes. Make your dialog box or view text colorful.

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.