如何将int数组从C#传递到C ++?

问题描述

我有一个用C ++编写的dll,目标方法的签名如下:

int __stdcall PrintColumn(LPSTR szHeader,int nNumColumns,LPINT nC,LPINT noC,LPSTR szFontName,int nFontSize,int nStyle,LPINT nBorderTop,LPINT nBorderBottom,LPINT nBorderLeft,LPINT nBorderRight,int nTextWrap)

现在,当我尝试从C#客户端调用此方法时,我会不断得到AccessViolationException。我尝试了以下等效的C#类型:

LPSTR -> StringBuilder / string
LPINT -> ref int / int[] / IntPtr

但是这些组合都不起作用。如何将数组整数传递给此dll?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...