🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.objectpascal
2 messages
2 total messages Started by nhsoft.xy Thu, 08 Dec 2005 14:45
what's the differences between AParam: P[Type] and var AParam: [Type] in dll import.
#55
Author: nhsoft.xy
Date: Thu, 08 Dec 2005 14:45
29 lines
1996 bytes
what's the differences between AParam: P[Type] and var AParam: [Type]
in dll import.
eg.
//C declaration:
//WORD DC_Mif_AntiCollision (DWORD *_dwSnr, BYTE _bMode = 1);
function DC_Mif_AntiCollision(var _dwSnr: Dword):WORD;Stdcall;external
'FOX_DC.dll';
function DC_Mif_AntiCollision(_dwSnr:PDword):WORD;Stdcall;external
'FOX_DC.dll';


And which is better. (It's a mifare1 api to operate IC Card Reader)
eg.
var
  dword_1: PDWORD;
  dword_2: DWORD;
begin
  //function DC_Mif_AntiCollision(var _dwSnr:
Dword):WORD;Stdcall;external 'FOX_DC.dll';
  GetMem(dword_1, SizeOf(DWORD));
  DC_Mif_AntiCollision(dword_1);
  DC_Mif_AntiCollision(dword_2);

  //function DC_Mif_AntiCollision(_dwSnr:PDword):WORD;Stdcall;external
'FOX_DC.dll';
  DC_Mif_AntiCollision(@dword_2);
  //TODO: which one is better???
end;
which one is better, and why?
Re: what's the differences between AParam: P[Type] and var AParam: [Type] in dll import.
#56
Author: Riki Wiki
Date: Sun, 11 Dec 2005 19:16
10 lines
1277 bytes
Hoi

You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this newsgroup
do not officially exist, use newsgroup b.p.d.language.delphi.general.

Take a look here:
<http://tinyurl.com/8m5nw>
which links to
<http://delphi.wikicities.com/wiki/Delphi_Newsgroups>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads