c++ cli - C++ CLI Wrapper -
i’ve question creating c++ cli wrapper native c++ class used in c#.
here example code:
#include "stdafx.h" #pragma once using namespace system; namespace wrapper { class nativeclass { public: nativeclass() {} int add(int a, int b) { return a+b; } }; public ref class wrapper { public: wrapper() {pnative = new nativeclass();} int add(int a, int b) { return(pnative->add(a,b)); } ~wrapper() { delete pnative; pnative = 0; } !wrapper() { this->~wrapper(); } //my problem here. nativeclass* getnative() { return pnative; } private: nativeclass* pnative; }; }
this code works fine. need retrieve pointer refers native class use in other wrapper classes. however, don’t want function “getnative” visible in c# when i’m using wrapper class. how can hide it?
if other wrapper classes in same assembly, make access internal instead of public. – roger rowland apr 25 '13 @ 9:47
.
if not in same assembly? ...
look friend assemblies – sebastian cabot feb 1 @ 15:43