Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:36:33+00:00 2026-06-15T11:36:33+00:00

I am exposing this C++/CLI property to COM and COM can only accept a

  • 0

I am exposing this C++/CLI property to COM and COM can only accept a reference type property for complex types (it won’t accept a pointer property). What is the best way to expose a class’ private member to be used with a reference property? I tried the following (and both don’t work because I am missing a pointer to reference or vice versa conversion somewhere):

private:
    Object _myProp;
public:
property Object %MyProp { 
    virtual Object %get() 
    {
        return _myProp;
    }
    virtual void set(Object %value) 
    {
        _myProp = value;  // this line doesn't work
    }
};

And I tried this:

private:
    Object ^_myProp;
public:
property Object %MyProp { 
    virtual Object %get() 
    {
        return _myProp;   // this line doesn't work
    }
    virtual void set(Object %value) 
    {
        _myProp = %value;
    }
};

What am I doing wrong here (given that I have to use a reference property)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:36:34+00:00Added an answer on June 15, 2026 at 11:36 am

    I was trying to use “^” to return _myProp, I discovered that I should be using “*”

    private:
        Object ^_myProp;
    public:
    property Object %MyProp { 
        virtual Object %get() 
        {
            return *_myProp;   // this line NOW works
        }
        virtual void set(Object %value) 
        {
            _myProp = %value;
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we're considering exposing some C# types to C++ clients via COM. What problems can
After long hours of investigation on exposing C# property that accepts a reference type
In this question it was discussed why exposing a private type with auto :
In ASP.net MVC4 there's this 'new' concept of a web API for exposing CRUD
If I am exposing a internal member via a Collection property via: public Collection<T>
What is the best approach for exposing a global variable from an MVC Layout
I wrote a mockup example to illustrate this without exposing anything confidential. It's a
Object graph for type '[type]' contains cycles and cannot be serialized if reference tracking
This is somewhat of a silly question.But... I am exposing a service of Street
This is probably a stupid question. I know I can wrap a ListView in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.