试着换了一下,用Varaint。这样虽然可以不用考虑参数个数和类型,但是不知道C里面是否可以这样用<br>硬件方面的完全不懂的说(C还好点,十窍通九……)<br>funcType = function (paramList: array of Variant): Variant;<br>procedure TForm1.btn2Click(Sender: TObject);<br>var<br> hInstance: HINST;<br> funcChar, funcInt: funcType;<br>begin<br> hInstance := LoadLibrary('dlla.dll');<br> funcChar := GetProcAddress(hInstance, 'maxChar');<br> funcInt := GetProcAddress(hInstance, 'maxInt');<br> ShowMessage(funcChar(['1', '2', funcInt([1, 2, 4])]));<br> FreeLibrary(hInstance);<br>end;<br>dllA------------------------------------------<br>function maxInt(intList: array of Variant): Variant;<br>var i: Integer;<br>begin<br> Result := intList[Low(intList)];<br> for i := Low(intList) to High(intList) do Result := Max(intList, Result);<br>end;<br><br>function maxChar(charList: array of Variant): Variant;<br>var iMin, iMax, i: Integer;<br>begin<br> iMin := Low(charList); iMax := High(charList); Result := charList[iMin];<br> for i := iMin + 1 to iMax do if charList > Result then Result := charList;<br>end;