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. Managed C++/CLI
  4. How to expose mixed class as COM class [modified typo rectified]

How to expose mixed class as COM class [modified typo rectified]

Scheduled Pinned Locked Moved Managed C++/CLI
csharpcomtutorial
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.
  • J Offline
    J Offline
    jayart
    wrote on last edited by
    #1

    I am at an initial stage of converting a mixed class to make it COM class. (and eventually a complete project) I googled a bit but have found information only for managed(C#) class. Typically the mixed class would look like

    // (in .h file)
    namespace MyNameSpace
    {
    public __gc class CPoint
    {
    public:
    CPoint();
    ~CPoint();
    CPoint(float x, float y, float z);
    __property void set_X(float x){ m_pPoint->m_x = x; }
    __property float get_X() {return m_pPoint->m_x;}
    public private:
    // some functions here
    };

    I have to expose this class as a COM class. I need an interface too. But not sure how to do this. Any link or information will be very helpful.

    modified on Monday, May 19, 2008 5:59 AM

    J 1 Reply Last reply
    0
    • J jayart

      I am at an initial stage of converting a mixed class to make it COM class. (and eventually a complete project) I googled a bit but have found information only for managed(C#) class. Typically the mixed class would look like

      // (in .h file)
      namespace MyNameSpace
      {
      public __gc class CPoint
      {
      public:
      CPoint();
      ~CPoint();
      CPoint(float x, float y, float z);
      __property void set_X(float x){ m_pPoint->m_x = x; }
      __property float get_X() {return m_pPoint->m_x;}
      public private:
      // some functions here
      };

      I have to expose this class as a COM class. I need an interface too. But not sure how to do this. Any link or information will be very helpful.

      modified on Monday, May 19, 2008 5:59 AM

      J Offline
      J Offline
      jayart
      wrote on last edited by
      #2

      Looks like I have to implement CCW (COM Collable wrapper) for the mixed class. Any examples or links in this regard wil be great.

      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