Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

delphi call C 的指標

0 views
Skip to first unread message

綠扁帽

unread,
Oct 16, 1996, 3:00:00 AM10/16/96
to

Hi, my friend;

我有下列兩個用 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

God

unread,
Oct 21, 1996, 3:00:00 AM10/21/96
to

※ 引述《pvm...@csie.nctu.edu.tw (綠扁帽)》之銘言:
: Hi, my friend;

在 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

0 new messages