|
The problem doesn't seem to be here
ufoprc
There is no C/C++ bit field in Delphi (VB is the same, so it uses integer)
Since PSTATE_NOW is a pointer in C, it should be defined like this in delphi
function GetKHTState(port:integer; var state:word):integer;stdcall; external'mtudll.DLL' name'GetKHTState';
Then, use state and shr separately to get the value of each state
var
state:word;
i:integer;
ifTel,ifRing,ifError,ifDtmf,dtmf,hd:integer;
begin
i:=GetKHTState(1,state);
Edit1.Text:=inttostr(i);
ifTel:=state and 1;
ifRing:=(state shr 1) and 1;
ifError:=(state shr 2) and 1;
ifDtmf:=(state shr 3) and 1;
dtmf:=(state shr 4) and $f;
hd:=(state shr 8) and $ff;
tried
All bits are 0, because it is an integer, the initial is 0, so nothing is actually returned
The program written with the VB they give can get an integer of 4098, and a binary of 1000000000010
Is ifRing bit is 1
Why can't I get the return number with DELPHI? |
|