C#调用C++问题

Carpathia 2009-08-18 11:39:47
BufferPlate(BYTE *pPlateBuffer,int w,int h,RECT *rect,char *result,BYTE *pcut);
FilePlate(char *pfile,RECT *rect,char *result,BYTE *pcut);
这2个C++中的方法,我在C#中调用的话,参数该如何设置,谢谢~~~~~~~
我的如下为
BufferPlate(byte[] pPlateBuffer,int w,int h,ref IntPtr rect,ref StringBuilder result,ref byte[] pcut);
FilePlate(string pfile,ref IntPtr rect,ref string result,ref byte[] pcut);
但未能成功,真诚请教,在线等,成功既送分,谢谢
...全文
80 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
chaozi_249 2009-08-19
  • 打赏
  • 举报
回复
其实很简单,你去MSDN上查下文本类型,看看对应的C#和C++都分别用什么表示。
Carpathia 2009-08-19
  • 打赏
  • 举报
回复
..........还是一样,头大了
Carpathia 2009-08-18
  • 打赏
  • 举报
回复
还是不行饿
qqiuzaihui 2009-08-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 qqiuzaihui 的回复:]
试试:
BufferPlate(byte[] pPlateBuffer, int w, int h, Rectangle rect, string result, byte[] pcut);
FilePlate(string pfile, Rectangle rect, string result, byte[] pcut);
[/Quote]
Rectangle rect 前可能要加关键字: ref或out, 如 ref Rectangle rect , 你自行试试.
qqiuzaihui 2009-08-18
  • 打赏
  • 举报
回复
试试:
BufferPlate(byte[] pPlateBuffer, int w, int h, Rectangle rect, string result, byte[] pcut);
FilePlate(string pfile, Rectangle rect, string result, byte[] pcut);
mwp 2009-08-18
  • 打赏
  • 举报
回复
string 改byte[] 或[MarshalAs(UnmanageType, LPStr,size=30)
Carpathia 2009-08-18
  • 打赏
  • 举报
回复
我自己顶

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧