返回值是int[];
但是在调用的时候会出现:无法封送处理“return value”: 无效的托管/非托管类型组合。
代码:
  [DllImport("SmartKeyIO.dll", EntryPoint = "GetSystemInfo"]
    public static extern int[] GetSystemInfo(int DeviceID, int DeviceType);
public static extern int[] GetSystemInfo(int DeviceID, int DeviceType);        int len = 4; //这里len的长度替换为GetSystemInfo函数返回的int数组的实际长度
        int[] systemInfo = new int[len];
        systemInfo = IC.GetSystemInfo(deviceID, deviceType);
求高手指点!

解决方案 »

  1.   

    额,是将哪里的int[] 换成IntPtr您能说的仔细点么?谢谢!
      

  2.   

    [DllImport("SmartKeyIO.dll", EntryPoint = "GetSystemInfo"]
      public static extern IntPtr GetSystemInfo(int DeviceID, int DeviceType);
    获取到IntPtr指针后用Marshal.PtrToStructure()转换或Marshal.ReadIntPtr()
      

  3.   

    改成public static extern IntPtr GetSystemInfo(int DeviceID, int DeviceType);
    后:无法在 DLL“SmartKeyIO.dll”中找到名为“GetSystemInfo”的入口点;
    高手能否远程帮我看一下啊!
      

  4.   

    麻烦了。
    数组不接受,指针找不到。
    你把原始的声明方式贴出来看看吧。
    就是C++,或VB,或delphi的声明
      

  5.   

    [DllImport("Kernel32.dll", EntryPoint = "GetSystemInfo"]
    public static extern IntPtr GetSystemInfo(int DeviceID, int DeviceType);
      

  6.   

    C/C++好象不能返回数组的,可以用int*p来取代的.
    估计那个C/C++函数有问题吧.
      

  7.   

    厂家没有说明吗??
    和厂家要掉哦那个方式,
    而且要个C#的就OK了。