Dialog Based MFC Dialog Based App and RichEdit ctl will not run???
Hi,
I just created what was supposed to be a simple MFC Dialog based app, i.e. checked "Dialog based" in the wizard and left ActiveX checked.
I setup my controls in the dialog and it worked OK.
However, now that I have added a RichEdit Control into the Dialog, it will not initialize, The dialog does not display and I just get a return code 0. No error message, no anything.
Compiler is VC 6 with the latest SP applied.
Hellpp!!??
Bryan.
Re: Dialog Based MFC Dialog Based App and RichEdit ctl will not run???
You have to call AfxInitRichEdit in your InitInstance function before
creating the dialog.
Re: Dialog Based MFC Dialog Based App and RichEdit ctl will not run???
Thanks Alex, tht works just fine.
Bryan.
Dialog Based RichEditControl and Ctrl Functions
Hi Alex,
I have another problem which you may be able to help me with....
As I said, this RichEdit Control is in a dialog, (in an RC file).
So how can I get its control so that I can do things like; SetSel() ReplaceSel() etc.
I know I can use GetDlgItem() but that gets me a CWnd, can I use that to get the ctrl, change text color by line, etc., etc.
This stuff doesn't seem to be covered anywhere.
I usually use RichEditView, so this Dialog box format seems to be a real problem.
Cheers,
Bryan.
Re: Dialog Based RichEditControl and Ctrl Functions
Bind RichEdit window to a CRichEditCtrl member variable using Class
Wizard like any other control.