Using Rich Edit Control or ip address control in a composite control 
Author Message
 Using Rich Edit Control or ip address control in a composite control

I am trying to use the Rich Edit control in a composite control but I keep receiving an error when I try to run it. I also noticed I get the same problem when using the ip address control. Most other controls seem to work fine. Any help would be great.

Thanks!
Kurt



Sat, 17 Apr 2004 07:25:47 GMT  
 Using Rich Edit Control or ip address control in a composite control

Has it ever occured to you that it may be useful for us to actually see the error message you get? You want your problem solved, don't you?
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken

  I am trying to use the Rich Edit control in a composite control but I keep receiving an error when I try to run it. I also noticed I get the same problem when using the ip address control. Most other controls seem to work fine. Any help would be great.

  Thanks!
  Kurt



Sat, 17 Apr 2004 07:28:59 GMT  
 Using Rich Edit Control or ip address control in a composite control

It's not really giving me an error message. I just get an assertion message at line 842 of atlctl.h. Basically saying CreateControlWindow failed.

Kurt

  Has it ever occured to you that it may be useful for us to actually see the error message you get? You want your problem solved, don't you?
  --
  With best wishes,
      Igor Tandetnik

  "For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken

    I am trying to use the Rich Edit control in a composite control but I keep receiving an error when I try to run it. I also noticed I get the same problem when using the ip address control. Most other controls seem to work fine. Any help would be great.

    Thanks!
    Kurt



Sat, 17 Apr 2004 07:42:43 GMT  
 Using Rich Edit Control or ip address control in a composite control

you have to call some Initialize method for RichEdit Control.  AfxInitRichEdit

Amrik

  It's not really giving me an error message. I just get an assertion message at line 842 of atlctl.h. Basically saying CreateControlWindow failed.

  Kurt

    Has it ever occured to you that it may be useful for us to actually see the error message you get? You want your problem solved, don't you?
    --
    With best wishes,
        Igor Tandetnik

    "For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken

      I am trying to use the Rich Edit control in a composite control but I keep receiving an error when I try to run it. I also noticed I get the same problem when using the ip address control. Most other controls seem to work fine. Any help would be great.

      Thanks!
      Kurt



Sat, 17 Apr 2004 10:23:54 GMT  
 Using Rich Edit Control or ip address control in a composite control
Hi,

The riched32.dll needed to be loaded.  

The resolution is to dynamically load it in the control's constructor.  

class ATL_NO_VTABLE CRichAtlCtrl :  ...
{ ...  
    HINSTANCE m_hREInstance;    
    CRichAtlCtrl()      
    {          
        m_hREInstance = LoadLibrary("RICHED32.DLL");
        m_bWindowOnly = TRUE;          
        CalcExtent(m_sizeExtent);      
    }  

    ~CRichAtlCtrl()    
    {          
        FreeLibrary(m_hREInstance);    
    }

Hope it helps.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
?2001 Microsoft Corporation.
All rights reserved.



Sat, 17 Apr 2004 16:42:04 GMT  
 Using Rich Edit Control or ip address control in a composite control

You need InitCommonControlsEx for IP Address control. For RichEdit, you need to manually call LoadLibrary on Riched32.dll (RichEdit 1.0) or Riched20.dll (RichEdit 2.0 and 3.0)
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken

  It's not really giving me an error message. I just get an assertion message at line 842 of atlctl.h. Basically saying CreateControlWindow failed.

  Kurt

    Has it ever occured to you that it may be useful for us to actually see the error message you get? You want your problem solved, don't you?
    --
    With best wishes,
        Igor Tandetnik

    "For every complex problem, there is a solution that is simple, neat, and wrong." H.L. Mencken

      I am trying to use the Rich Edit control in a composite control but I keep receiving an error when I try to run it. I also noticed I get the same problem when using the ip address control. Most other controls seem to work fine. Any help would be great.

      Thanks!
      Kurt



Sat, 17 Apr 2004 22:41:39 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Composite Control using rich edit control question

2. Using Rich Edit in composite control

3. Rich Edit in a composite control

4. Rich edit control on Control dialog bar

5. Controlling Scrolling in Rich Edit Control

6. Edit Control...Edit Control...Edit Control...Edit Control...Edit Control...

7. A composite control calling another composite control in web browser

8. Composite control hosted by a composite control.

9. ???: VC++ 5.0: need IP address edit control.

10. Using ActiveX controls in ATL Composite control

11. mfc control instantiated in atl composite control using CAxWindow wont destruct

12. Using Hyperlinks in Rich Edit Control to open another application

 

 
Powered by phpBB® Forum Software