呼叫
getconnectiondevice(unsigned int:vid;unsigned int:pid;unsigned int *No);
我在
type里定義函式如下:
TGetConnectedDevices=function(vid:Uint32;pid:Uint32;noOfDevs:PUint32):Integer;stdcall; //called correctly.
.
.
.
函式呼叫成功.................。
現在有一個這樣的函式:
void* OpenByIndex(unsigned int: vid;unsigned int: pid;unsigned int : index)
return(void*) -- the handle of device。
請問一下,這個在type里應該如果定義呢?
uj5u.com熱心網友回復:
typeTOpenByIndex = function(vid, pid, index: cardinal): THandle; stdcall;
uj5u.com熱心網友回復:
typeprocedure OpenByIndex(vid : UInt; pid : Uint; index : UInt):Pointer;stdcall;
或者
type
procedure OpenByIndex(vid : UInt; pid : Uint; index : UInt):Pointer;cdecl;
具體呼叫約定是stdcall還是cdecl要看對方
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/60222.html
標籤:VCL組件開發及應用
