我有C++ dll的类,我想从C#代码发送字符串,surly我不能使用字符串,因为CLR,我会努力将字符串更改为C++ dll中的字符,并且从c#发送字节(因为在c#中的c + +字节=字节),但c#不理解c + +数组我可以发送1字节,它会好的,但不是数组,请帮助! DLL代码:在C#中使用C++代码
public ref class Coding
{
public:
void HillCoding(char filePath[])
{
...
}
};
你可以与我们分享C++函数的签名吗? – Raphael 2010-11-06 21:17:26
在'P/Invoke'的运行时,CLR会将'string'转换为'char *'我相信 – 2010-11-06 21:17:51
[将非空终止的字符串传递给非托管代码](http://stackoverflow.com/questions/ 3435163/passing-non-null-terminated-strings-to-unmanaged-code) – Hogan 2010-11-06 21:18:48