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 ()