c ++ / cli包装器的基本结构是什么,所以可以从c#中调用它?
答案 0 :(得分:2)
C ++类Blah的包装器:
修改强>
ref class BlahWrapper {
BlahWrapper () {
blah = new Blah();
}
!BlahWrapper() { //Destructor called by GC
if (blah != null) {
delete blah;
blah = null;
}
}
~BlahWrapper() { //Dispose() called in "using" blocks, or manually dispose
if (blah != null) {
delete blah;
blah = null;
}
}
private:
Blah* blah;
}