原动态链接库UA300.DLL中的函数原型为:
void_stdcall readdata(HANDLE husb, short* addat, unsigned short fcode, long leng)
在C#中调用,如下改写是否正确?
[DllImport("UA300.DLL", CharSet = CharSet.Unicode, EntryPoint = "readdata",SetLastError=true,ExactSpelling=true,CallingConvention=CallingConvention.StdCall,PreserveSig=true)]
        
 unsafe public static extern void readdata(IntPtr husb, short* addat, ushort fcode, Int32 leng);   unsafe public short[] data = new short[4096];  
   unsafe private void button1_Click(object sender, EventArgs e)
        {                  
          
            fixed (short* k = data)
            {
                readdata(husb, k , 3000, 256);  
            }   
经试验还是不行,改如何改动啊??急,谢谢