Имеется след.код
var LineApp: Cardinal;
DeviceCount,fDeviceID: Cardinal;
tapiVersion: Cardinal;
ExtId: TLINEEXTENSIONID;
CallParams: TLINECALLPARAMS;
hLine:TLine;
Call:HCALL;
VarStrRec:LPVARSTRING;
PhoneNum:array[0..30] of char;
Handle:HWND;
const VarStrAllocSize = SizeOf(TVarString) + 1024;
begin
DeviceCount := 0;
ApiCheck(LineInitialize(LineApp,MainInstance, DummyTapiCallbackProc, nil, DeviceCount));
try
if DeviceCount = 0 then Exit;
fDeviceID:=ComboBox1.ItemIndex;
ApiCheck(LineNegotiateAPIVersion(lineApp, fDeviceID, mVer, hVer, tapiVersion, extid));
FillChar(CallParams, SizeOf(CallParams),0);
with CallParams do
begin
dwTotalSize := SizeOf(CallParams);
dwMinRate:=9600;
dwMaxRate:=9600;
dwMediaMode := LINEMEDIAMODE_DATAMODEM;
end;
ApiCheck(lineOpen(LineApp,fDeviceID,hLine,tapiVersion,0,0,
LINECALLPRIVILEGE_MONITOR +LINECALLPRIVILEGE_OWNER,
LINEMEDIAMODE_DATAMODEM,CallParams));
StrPCopy(PhoneNum,'P806712345678');
ApiCheck(LineMakeCall(hLine,Call,PhoneNum,0,@CallParams));
VarStrRec:=nil;
try
GetMem(VarStrRec, VarStrAllocSize);
VarStrRec.dwTotalSize := 1024;
ApiCheck(LineGetID(hLine,0,Call,LINECALLSELECT_CALL,VarStrRec,'comm/datamodem')); вот тут ошибка
Handle := PInteger(PChar(@VarStrRec) + VarStrRec.dwStringOffset)^;
finally
if Assigned(VarStrRec) then FreeMem(VarStrRec);
end;
ApiCheck(lineClose(hLine));
finally
ApiCheck(LineShutdown(LineApp));
end;
end;
Ошибка Error 80000018 (неверный дескриптор).
Полное описание : The specified call handle is not valid. For example, the handle is not NULL but does not belong to the given line. In some cases, the specified call device handle is invalid.
Как мне кажется, все делаю правильно. В чем причина неудач?
Спасибо!