Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. RichEditCtrl Failed to create

RichEditCtrl Failed to create

Scheduled Pinned Locked Moved COM
comhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ssirisha
    wrote on last edited by
    #1

    The following code works fine.. CoInitialize(NULL); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); However the following fails.. CoInitializeEx(NULL, COINIT_MULTITHREADED); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); I remember having read somewhere that RichEdit control uses OLE (ie CoInitialize(NULL)). Is that the problem ? Any solution ? Thanks

    C 2 Replies Last reply
    0
    • C Carlos Antollini

      Did You put AfxInitRichEdit in the initinstance? ;) Regards... Carlos Antollini. www.wanakostudios.com Sonork ID 100.10529 cantollini

      S Offline
      S Offline
      ssirisha
      wrote on last edited by
      #2

      Yes I did.. Should I put "AfxInitRichEdit" Before or After CoInitialize.. Thanks

      1 Reply Last reply
      0
      • S ssirisha

        The following code works fine.. CoInitialize(NULL); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); However the following fails.. CoInitializeEx(NULL, COINIT_MULTITHREADED); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); I remember having read somewhere that RichEdit control uses OLE (ie CoInitialize(NULL)). Is that the problem ? Any solution ? Thanks

        C Offline
        C Offline
        Carlos Antollini
        wrote on last edited by
        #3

        Did You put AfxInitRichEdit in the init instance? ;) Regards... Carlos Antollini. www.wanakostudios.com Sonork ID 100.10529 cantollini

        1 Reply Last reply
        0
        • S ssirisha

          The following code works fine.. CoInitialize(NULL); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); However the following fails.. CoInitializeEx(NULL, COINIT_MULTITHREADED); m_cRichEditCtrl.Create(ES_READONLY, rect, GetDlgItem(IDC_G), 1); I remember having read somewhere that RichEdit control uses OLE (ie CoInitialize(NULL)). Is that the problem ? Any solution ? Thanks

          C Offline
          C Offline
          Carlos Antollini
          wrote on last edited by
          #4

          Did You put AfxInitRichEdit in the initinstance? ;) Regards... Carlos Antollini. www.wanakostudios.com Sonork ID 100.10529 cantollini

          S 1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups