Home > Back-end >  About DLL pointer function calls, to define the type void * OpenByIndex (unsigned int: vid. Unsigned
About DLL pointer function calls, to define the type void * OpenByIndex (unsigned int: vid. Unsigned

Time:09-21

The
Getconnectiondevice (unsigned int: vid; Unsigned int: pid; Unsigned int * No);
I am
Type defined in the function is as follows:

TGetConnectedDevices=function (vid: Uint32; Pid: Uint32; NoOfDevs: PUint32) : Integer; Stdcall;//called correctly.
.
.
.
A function call success... ,

There is now a function like this:
Void * OpenByIndex (unsigned int: vid; Unsigned int: pid; Unsigned int: index)

Return (void *) - the handle of the device,

Excuse me, if this should be in the type definition?

CodePudding user response:

Type
TOpenByIndex=function (vid and pid, the index: cardinal) : THandle; Stdcall;

CodePudding user response:

Type
Procedure OpenByIndex (vid: UInt; Pid: Uint; Index: UInt) : the Pointer; Stdcall;
Or
Type
Procedure OpenByIndex (vid: UInt; Pid: Uint; Index: UInt) : the Pointer; Cdecl;
Specific calling convention is stdcall also cdecl depends on each other
  • Related