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. Mixing native OLE with MFC interface/wrappers

Mixing native OLE with MFC interface/wrappers

Scheduled Pinned Locked Moved COM
c++com
2 Posts 2 Posters 8 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi, I have noticed that certain OLE functions dont have MFC wrappers one in particaular Is OpenText I have noticed also that it seems that for those functions that dont have MFC wrappers, they use a generic AUTOWRAP function Which is base on native OLE functions such as IDispatch I have intlized OLE using MFC/Framework AfxOleInit to use native ole functions would I have to do intilzations twice e.g. CoInitlize(NULL) and then CoCreateInstance I need MFC as I would like use Windows Service in this program Please Advise Thanks

    D 1 Reply Last reply
    0
    • F ForNow

      Hi, I have noticed that certain OLE functions dont have MFC wrappers one in particaular Is OpenText I have noticed also that it seems that for those functions that dont have MFC wrappers, they use a generic AUTOWRAP function Which is base on native OLE functions such as IDispatch I have intlized OLE using MFC/Framework AfxOleInit to use native ole functions would I have to do intilzations twice e.g. CoInitlize(NULL) and then CoCreateInstance I need MFC as I would like use Windows Service in this program Please Advise Thanks

      D Offline
      D Offline
      DriveByCoder
      wrote on last edited by
      #2

      You don't need to call CoInitialize() again. You will need to check to see if the MFC interfaces are dual or not. If they are you can use then as if that are non-automation interfaces. I.e. just go obj->SomeMethod(); My guess is probably not, in which case you will have to use IDispatch->Invoke(...) which is a real pain. I'm sure you can find helper code out there on the Web.

      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