PShort = ^ShortInt;
funtion xxx(a:PShort):integer;

解决方案 »

  1.   

    Type ArrayPointer = Array of Shortint;funtion xxx(a:^ArrayPointer):integer—————————————————————————————————
    MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
                 毁誉由人,望天上云卷云舒,聚散任风。';
    if Not Assigned(I) then
      I := TI.Create(Nil);
    I.Maxim := MaximStr;
    I.Explain := '假如上述代码中出现“OA”、“3D”等字样,改为“=”或者去掉';
    I.Desire := '加不加分随你';
    —————————————————————————————————
        
      

  2.   

    function XXX(a : array of shortint): Integer; stdcall; external 'yourfile.DLL';
    你试试。
      

  3.   

    funtion xxx(var a:Shortint):integer;var a:shortint;
      xxx(@a);
      

  4.   

    也有可能
       funtion xxx(a:pchar):integer;
      

  5.   

    你的意思是说a是一个short类型的数组的首地址吗?
    type 
      ShortAry = array[0..32767] of Smallint;
      PShortAry = ^ShortAry;function xxx(a:PShortAry):integer;调用时:
    var
      b: PShortAry;
      i: Smallint;
    begin
      b := AllocMem(5 * SizeOf(Smallint));
      for i := 0 to 4 do 
        b[i] := i;
      Result := xxx(b);
      FreeMem(b);
    end;PChar就是这样声明的.
    注意:
    1.要声明成静态数组的指针.因为动态数组实际上是一个表态数组加一个长度,如果要从其它程序返回指针时,会由于长度不对而出错误.
    2.C中的short并不是Delphi中的ShortInt,而是SmallInt.