Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I have two classes (wrapper to unman C++) creating instances of one in the other, each class has a auto_ptr<unmanaged class=""> variable which holds the pointer to the unmanaged class and now it's public so I can call it like
C#
managed_class_instance.pointercontainer
but it give's me warning
C#
Warning C4677: 'pointercontainer': signature of non-private member contains assembly private type 'msclr::auto_ptr<T>'   

I understand why this is happening ,it's because a type that is visible outside the assembly contains a member function whose signature contains a native type that is not visible outside the assembly. I can not make it private for obvious reasons, and I want to bind it to this assembly with something like
C#
internal msclr::auto_ptr<unmanaged_class> pointercontainer;
but this doesn't work and gives me
C#
Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	


So I have another wrapper in C# around this CLI one that the developer sees and he should not have access to pointercontainer. I know I can take care of all this in the C# but I also would like to do it in the CLI wrapper also.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900