typedef struct _PARA {
    unsigned long  f1;
    unsigned short f2;
    unsigned short f3;
    unsigned char  f4[ 8 ];
} PARA;typedef void* handle_a;
__declspec(dllexport) handle_a __stdcall Open(const u_long id, PARA* para);在c#中要怎么定一结构体?怎么调用这个函数呢?

解决方案 »

  1.   

     public struct PARA
            {
                public uint f1;
                public ushort f2;
                public ushort f3;
                [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 8)]
                public byte[] f4;
            }使用 ref传递看看行不行