如何使用C++;C#上的运算符抛出DLL?

如何使用C++;C#上的运算符抛出DLL?,c#,c++,dll,type-conversion,C#,C++,Dll,Type Conversion,我必须在我的C#项目中使用C++并且必须在Visual Studio 2013上构建一个DLL。这是我第一次这样做,所以我面临一些问题。我试图通过引用导入一些带有运算符重载的方法和常量参数,如下所示: [DllImport("CloudMeshDll.dll")] public static extern SpecialString& operator+=(const IntPtr p_InStr); //const char* p_InStr [DllImport("CloudMes

我必须在我的C#项目中使用C++并且必须在Visual Studio 2013上构建一个DLL。这是我第一次这样做,所以我面临一些问题。我试图通过引用导入一些带有运算符重载的方法和常量参数,如下所示:

[DllImport("CloudMeshDll.dll")]
public static extern SpecialString& operator+=(const IntPtr p_InStr); //const char* p_InStr

[DllImport("CloudMeshDll.dll")]
public static extern int operator!=(const SpecialString &p_InObj);
没用,有什么提示吗


谢谢。

您不能使用pinvoke C++方法,需要C++/CLI包装器。您是指一般情况还是针对这种特定情况?