Notes for using RichEdit in VC/MFC

Source: Internet
Author: User

By default, the installed VC ++ 6.0sp6 will have the RichEdit bug modification method.

When using the RichEdit control in the toolbar in MFC, it should be used in the dialog box Constructor

Afxinitrichedit () or afxinitrichedit2 ().

Example: boolcencoderconnectapp: initinstance ()
{
Afxenablecontrolcontainer ();
Afxinitrichedit ();
// Standard Initialization
// If you are not using these features and wish to reduce the size
// Of your final executable, you should remove from the following
// The specific initialization routines you do not need.

# Ifdef _ afxdll
Enable3dcontrols (); // call this when using MFC in ashared DLL
# Else
Enable3dcontrolsstatic (); // call this when linking to mfcstatically
# Endif

Cencoderconnectdlgdlg;

M_pmainwnd = & DLG;
Int nresponse = DLG. domodal ();
//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ////////////////////////

Put in oninitdialog () does not work, otherwise,ProgramWill not run, and there is no compilation error message. These two functions load riched1_dll (riched32.dll. The method for loading the dynamic link library is to use this sentence in the header file stdafx. h or constructor.Code:

loadlibrary (_ T ("richeddll DLL ")); or loadlibrary (_ T ("riched32.dll"); if you want to respond to the onenchange event of the rich edit control, you need to add it in oninitdialog ()

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.