Questions tagged «interop»

互操作性是一种计算机系统或编程语言与另一种计算机系统或编程语言一起工作的要求。


5
是否可以从C#.Net调用C函数
我有一个C库,想从C#应用程序中调用此库中的函数。我尝试通过将C lib文件添加为链接器输入并将源文件添加为其他依赖项来在C lib上创建C ++ / CLI包装器。 有什么更好的方法可以实现这一点,因为不确定如何将C输出添加到c#应用程序中。 我的C代码- __declspec(dllexport) unsigned long ConnectSession(unsigned long handle, unsigned char * publicKey, unsigned char publicKeyLen); 我的CPP包装器- long MyClass::ConnectSessionWrapper(unsigned long handle, unsigned char * publicKey, unsigned char publicKeyLen) { return ConnectSession(handle, publicKey, publicKeyLen); }
70 c  c#-4.0  interop 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.