Is there a way to call internal method with native parameter from ref class in another C++/CX WinRT component? I know there is solution via pointers exposed as int, but is there any better way? Something like to include header files from other lib and not using managed reference (this way I got error message from C# Component3 "error CS0433: The type 'Class1' exists in both 'Component1' and 'Component2'" in other component that consumes these both)...
Component1/class1.h:
public ref class Class1 sealed
{
internal:
bool InternalMethodForComponent2(NativeType& param1);
public:
Class1();
virtual ~Class1();
int SomeMethodForComponent3();
private:
};
Component2/class2.cpp:
//#include "Component1/class1.h" - replaced by adding reference because of CS0433 in Component3
void Class2::SomeMethod(Class1^ obj)
{
NativeType nt;
nt.start = 1;
...
obj->InternalMethodForComponent2(nt); //does not work - error C2039: 'InternalMethodForComponent2' : is not a member of 'Component1::Class1'
}
Component3/class3.cs:
void MethodInClass3()
{
Class1 obj1 = new Class1();
Class2 obj2 = new Class2();
obj2.SomeMethod(obj1);
var res = obj1.SomeMethodForComponent3();
}