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. C / C++ / MFC
  4. How to prepare code for using COM

How to prepare code for using COM

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialcomhelp
2 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.
  • D Offline
    D Offline
    dudic
    wrote on last edited by
    #1

    I have a problem with using COM in my application. For example, I create a simple dialog-based application in VC6 and I want to use COM here. What header files and where do I have to add, may be something I have to change in project settings.

    R 1 Reply Last reply
    0
    • D dudic

      I have a problem with using COM in my application. For example, I create a simple dialog-based application in VC6 and I want to use COM here. What header files and where do I have to add, may be something I have to change in project settings.

      R Offline
      R Offline
      Rory Solley
      wrote on last edited by
      #2

      Just make sure you call CoInitialize[Ex] to create a COM apartment and CoUnInitialize to destroy it (before exiting your app). It can do no harm to include comdef.h if you want to use some of the COM helper classes such as _variant_t. Also, you might want to set the _WIN32_DCOM preprocessor directive which will include all the relevant COM headers. Hope that helps...

      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