标签:
一 混合类
所谓混合类是指CLI/C++中native的Class中可以包含CLR对象,CLR的class也可以包含Naitve的对象。
1)native的class中包含CLR对象,必须通过gcroot<>或auto_gcroot<>。
2)CLR中的class中包含native的对象,必须是指针,也可以使用高手写的CAutoNativePtr智能指针。
注意:C#中不能调用CLI/C++中的Native的class。同样Native C++中也不能调用CLI/C++中的Ref的class。
二 实例
高手的CAutoNativePtr类:
标签:
原文地址:http://www.cnblogs.com/mazhenyu/p/5607062.html