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. Passing CRichEditCtrl pointer to COM

Passing CRichEditCtrl pointer to COM

Scheduled Pinned Locked Moved COM
c++questioncomhelp
2 Posts 1 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.
  • B Offline
    B Offline
    BazM
    wrote on last edited by
    #1

    Hi, I'm just starting to use COM dlls but have come across what I believe must be a common problem for brainwashed MFC folk... absolutely any suggestions would be welcome! I have a standard Windows app generated using Visual C++ V6.0 which uses a CRichEditCtrl control. The app is served by several COM dlls. I would really like to dedicate one of the COM dlls to displaying the information in the CRichEditCtrl control. The problem is how do I tell the COM dll the pointer to the control?. I have tried passing the control window handle (hwnd) and then using SendMessage(hwnd,,,). Thats OK for raw text but when I want to (say) get the defaultcharformat I really need the control's CRichEditCtrl* pointer. I guess I could pass a void ptr and then cast to CRichEditCtrl* - but this seems to go against good COM practice? Can anybody recommend a COM friendly solution and restore my initial enthusiasm to program with COM! Many Thanks BarryM :sigh:

    B 1 Reply Last reply
    0
    • B BazM

      Hi, I'm just starting to use COM dlls but have come across what I believe must be a common problem for brainwashed MFC folk... absolutely any suggestions would be welcome! I have a standard Windows app generated using Visual C++ V6.0 which uses a CRichEditCtrl control. The app is served by several COM dlls. I would really like to dedicate one of the COM dlls to displaying the information in the CRichEditCtrl control. The problem is how do I tell the COM dll the pointer to the control?. I have tried passing the control window handle (hwnd) and then using SendMessage(hwnd,,,). Thats OK for raw text but when I want to (say) get the defaultcharformat I really need the control's CRichEditCtrl* pointer. I guess I could pass a void ptr and then cast to CRichEditCtrl* - but this seems to go against good COM practice? Can anybody recommend a COM friendly solution and restore my initial enthusiasm to program with COM! Many Thanks BarryM :sigh:

      B Offline
      B Offline
      BazM
      wrote on last edited by
      #2

      Hi, I eventually passed a long* ptr and casted back to CRichEditCtrl* in the COM method. Not nice but it seems to work. I hope to eventually discover the proper "COM" method of approaching this problem! BM :-O

      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