c# 执行时无法封送参数的问题

阳明阳明 2010-12-24 05:19:47

public struct TLQQUE_LIST
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10000* (48+ 1))]
public char[] queNames; /* 保存返回的队列名 */
public int queNum; /* 队列个数 */
}
[DllImport("tl_api.dll")]
public static extern int Tlq_GetQueueList(ref TLQ_ID gid,ref TLQ_QCUHDL qcuHandle,int queType, ref TLQQUE_LIST quelist,ref TLQError tlq_errstru);




以上将c动态库中调用 Tlq_GetQueueList函数,c原型:

int Tlq_GetQueueList(TLQ_ID *gid,TLQ_QCUHDL *qcuHandle,int queType, TLQQUE_LIST *quelist,TLQError *tlq_errstru)


调用c#的代码执行时 报错:
未处理的异常: System.Runtime.InteropServices.MarshalDirectiveException: 无法封
送处理“parameter #4”: 内部限制: 结构太复杂或太大。

求解决。谢谢!~

...全文
387 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

111,101

社区成员

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

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

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