Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subclassing CRichEditCtrl

Status
Not open for further replies.

timmay3141

Programmer
Dec 3, 2002
468
US
I'm trying to subclass CRichEditCtrl because I want to format numbers differently than characters. We'll call the subclass CMyEditCtrl. I follow the normal procedure (make a new class derived from CRichEditCtrl, change the necessary functions), but when I try to add a control with the ClassWizard, the only class that appears on the Variable Type combo box is CRichEditCtrl. I did the same exact procedure except derived from CEdit, and my subclass showed up in the combo box with CEdit, so I don't think the error is procedural. Regardless, I decided to make the control CRichEditCtrl so it would take care of some code for me, and then I went to the declaration and changed CRichEditCtrl to CMyEditCtrl and it worked fine. All I want to know is why it wouldn't let me select it the normal way. I'm going to have to add a lot of these controls - I could just do what I did here, but it's a bit inconvenient and I don't see why this should be happening.
 
Probably because ClassWizard isn't 100% bug free. I'd say it's because back in the days (Windows 3.x) there were no Rich Edit controls, only the simple ones (editbox, pushbutton, listbox, combobox, checkbox, radiobutton, and static). They probably just didn't update ClassWizard to handle the new (Win95) Common Controls.

[sub]I REALLY hope that helps.[/sub]
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top