且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

元帅C ++"串"在C#中的P / Invoke类

更新时间:2023-02-15 20:18:21

看起来你试图使用C ++标准库的string类。我怀疑,这将是很容易元帅。***坚持使用一个char *元帅为StringBuilder的。这就是我通常做。你必须添加一个包装器,生成的C ++字符串为您服务。

Looks like you're trying to use the C++ standard library string class. I doubt that will be easy to Marshal. Better to stick with a char * and Marshal as StringBuilder. That's what I usually do. You'll have to add a wrapper that generates the C++ string for you.