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)?