So I've got an interface (IInterface1) exposed as ComVisible(true), ClassInterfaceType(ClassInterfaceType.None).
I have an object on that Interface, ala:
public interface IInterface1
{
Object1 object {get; set;}
}
Object one is also ComVisible(true), is in a separate assembly, ClassInterfaceType(ClassInterfaceType.None), and looks like so:
public interface IObject1
{
string MyProperty {get;set;}
}
In C# still, I've got the following class:
public class Interface1 : IInterface1
{
public IObject1 Object1 {get;set;}
}
From unmanaged C++, how would I access Interface1.Object1.MyProperty? I'm importing the TLH raw_interfaces_only, can CreateInstance my Interface1 class, and access Object1. If I try to access MyProperty on Object1, I get a "pointer to incomplete class type not allowed".
The c++ code looks like:
Assembly1::Interface1Ptr interface1ptr;
HRESULT hrRetval = CoInitialize(NULL);
hrRetval = interface1ptr.CreateInstance(__uuidof(Assembly1::Interface1));
Assembly1::Object1 *object1;
hrRetval = interface1ptr.get_Object1(&object1);
This is where I'm stuck:
hrRetval = object1->get_MyProperty(varToStore); // This doesn't work.
Appreciate any pointers (har har).