我有下列兩個用 C 寫的 DLL function :
(1) void SendPointer(int *x1, int y);
where x1 is a pointer of int, and size is 40.
當我 call SendPoint 之後, 我可以存取 x1[1] .. x[40] 間的數值.
(2) void huge* PTfct( int x);
請問這兩個function在delphi中該如何宣告, 且(1),(2) 在delphi 中, 該如何
使用 ?
With Regard --- pvm
在 Delphi 如下宣告就可以呼叫你所撰寫的 DLL
...
interface
...
type
arrayData : array[ 0..39 ] of integer;
...
var
....
procedure SendPointer( x : arrayData ; y : integer );stdcall;
function PTfct( x : integer ):Pointer;stdcall;
...
implementaion
....
procedure SendPointer;external 'DLL name';
function PTfct; external 'DLL name';
.....
然後就可以在 Delphi 的程式中,呼叫這兩個函式了。
至於使用的方式就如同呼叫一般的函式一樣就可以了。
--
※ Origin: 中原電機心站 ◆ From: 140.135.96.12