I have the following COM types: Project, ContainerItem and Node.
Project has a collection property with an Append function that accepts ContainerItems.
In C#, using type libraries I can send a Node object to the Append function and the library works as expected:
var prj = new Project();
var node = new Node();
prj.collection.Append(node);
In C++ I tried a direct pointer cast expecting this is what C# was doing, but it ends up in an error:
ProjectPtr prj;
prj.CreateInstance(__uuidof(Project));
NodePtr node;
node.CreateInstance(__uuidof(Node));
prj->collection->Append((ContainerItem**)&node.GetInterfacePtr());
Is there a specific way to these type of COM pointer casts in C++? What am I missing?
AppendtakesContainerItem**as a parameter. That would make no sense. What's the declaration ofAppend? What's the relationship, if any, betweenNodeandContainerItem?