草庐IT

vtIntArg

全部标签

c# - 如何将 IntPtr 传递给非托管 C++ CLR 托管代码的方法?

我正在使用本教程作为我在32位非托管DLL中的代码的基础https://code.msdn.microsoft.com/CppHostCLR-e6581ee0假设我想调用TestIntPtrpublicclassIntPtrTester{publicstaticvoidTestIntPtr(IntPtrp){MessageBox.Show("TestIntPtrMethodwasCalled");}publicstaticvoidTestInt(intp){MessageBox.Show("TestIntMethodwasCalled");}}如果在C++端它代表句柄,我如何传递Int