平台调用关与结构中嵌套结构数组参数、动态数组的封装

mgj200408 2004-11-21 05:43:49
[StructLayout(LayoutKind.Sequential)]
public struct Point {
public int x;
public int y;
//动态数组
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst=3 )]
public string Str;
//这里怎么写结构数组参数
public struct A a;
}

[StructLayout(LayoutKind.Sequential)]
public struct A
{
public int i;
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst=3 )]
public string str;

}

...全文
88 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Fu7iang 2005-04-04
  • 打赏
  • 举报
回复

 这个可能有用:
 
 ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpguide/html/cpconmarshalingclassesstructuresunions.htm
marvelstack 2005-04-04
  • 打赏
  • 举报
回复
对于[StructLayout]的使用,合理使用内存
http://www.microsoft.com/china/MSDN/library/netFramework/netframework/MemoryOptim.mspx

110,570

社区成员

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

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

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