CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC Framework 2.0
  • ADO.NET Data Services in the .NET Framework
  • Visual C++ Programming: What's new for MFC library in VC++ 2010?
  • Microsoft Visual Studio LightSwitch and What It Can Do For You

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old December 8th, 2009, 12:34 AM
    sm_ch sm_ch is offline
    Member
     
    Join Date: Mar 2002
    Posts: 286
    sm_ch is an unknown quantity at this point (<10)
    dynamic insert activex controls into richedit.

    dear friends:

    I have succeed in inserting my control into richedit.

    CDrawCtrl is my activex control and it can auto adjust it's size by SetInitialControlSize AND SetControlSize.
    ------------------------------------------------
    <CODE>
    CDrawCtrl *pCDrawCtrl = new CDrawCtrl ;
    for(int i = m_iMaxControlID; i < 6666; i++)
    {
    if(NULL == GetDlgItem(i))
    break;
    }
    m_iMaxControlID = i;
    pCDrawCtrl->Create("", WS_CHILD, CRect(0, 0, 0, 0),this, m_iMaxControlID);
    </CODE>
    ------------------------------------------------
    then I insert the pCDrawCtrl with REOBJECT.
    The problem is that everything I draw in CDrawCtrl::OnDraw will draw not only in the rect provided by richedit with richedit but also in the rect which is defined in
    <CODE>
    pCDrawCtrl->Create("", WS_CHILD, CRect(0, 0, 0, 0),this, m_iMaxControlID);
    </CODE>

    when I double click in the rect provided by richedit the focus may be with this rect. Then I can not select the object by click the rect provided by richedit.

    Anyone help me?
    Thanks.

    Last edited by sm_ch; December 8th, 2009 at 01:02 AM. Reason: error
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:40 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.