newbie: subclassing richedit in an ActiveX MFC ctl 
Author Message
 newbie: subclassing richedit in an ActiveX MFC ctl

(VS6 SP5, NT5) I'm try to subclass a Richedit control (2.0 or 3.0) in an
ActiveX MFC control, but I must have missed something: the control is drawn
in the container, but when I type something, no text appears even if the
cursor moves as I type (without clearing its previous positions, so that I
get tons of tight vertical lines on each text line) and the scroll bars
appear and update as expected. Also, if I resize it the previous control
window is not cleared. Could anyone point me in the right direction?

Here's what I'm doing:

1) create a new ActiveX ctl via the Wizard: act as a frame, subclass window
class RichEdit20A. I add the following code in the control constructor and
destructor to load the RTF library:

2) constructor:
    m_hRTF = ::LoadLibrary("RICHED20.DLL");

3) destructor:
     if (m_hRTF)
     {
      ::FreeLibrary(m_hRTF);
      m_hRTF = NULL;
     } //eif

OnDraw just calls DoSuperclassPaint as done by Wizard; IsSubclassedControl
rets TRUE.

Thanx in advance!



Mon, 05 Jan 2004 04:26:03 GMT  
 newbie: subclassing richedit in an ActiveX MFC ctl
Use SubclassDglItem or SubclassWindow.



Quote:
> (VS6 SP5, NT5) I'm try to subclass a Richedit control (2.0 or 3.0) in an
> ActiveX MFC control, but I must have missed something: the control is
drawn
> in the container, but when I type something, no text appears even if the
> cursor moves as I type (without clearing its previous positions, so that I
> get tons of tight vertical lines on each text line) and the scroll bars
> appear and update as expected. Also, if I resize it the previous control
> window is not cleared. Could anyone point me in the right direction?

> Here's what I'm doing:

> 1) create a new ActiveX ctl via the Wizard: act as a frame, subclass
window
> class RichEdit20A. I add the following code in the control constructor and
> destructor to load the RTF library:

> 2) constructor:
>     m_hRTF = ::LoadLibrary("RICHED20.DLL");

> 3) destructor:
>      if (m_hRTF)
>      {
>       ::FreeLibrary(m_hRTF);
>       m_hRTF = NULL;
>      } file://eif

> OnDraw just calls DoSuperclassPaint as done by Wizard; IsSubclassedControl
> rets TRUE.

> Thanx in advance!




Mon, 05 Jan 2004 16:42:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Ctl-C, Ctl-X and Ctl-V in RichEditCtrl

2. SubClassing Dialog Ctl - Question ?

3. # of visible lines in a RichEdit Ctl?

4. Subclassing Activex controls from commctrl (treectrl) in MFC

5. Subclassing Control (pref. RichEdit)

6. ActiveX Ctl within a List Control

7. Pro. in ActiveX Ctl of ATL

8. ActiveX ctl runs ok in Release but only at design time

9. sharing data between Excel sheed and ActiveX ctl

10. Pro. in ActiveX Ctl of ATL

11. Q: ActiveX CTL Getting Printer Info From Container

12. Security Alert with ActiveX ctl

 

 
Powered by phpBB® Forum Software