j'essay d'initialiser la Telephony API avec les deux méthodes :
initialize et initializeEX. Mais j'ai l'erreur 80000035 LINEERR_INVALPOINTER.
extrait du code :
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TAPI, TAPI3Err, TSPI, StdCtrls, Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BTN_InitTapi: TSpeedButton;
TapiInform: TMemo;
Label1: TLabel;
BTN_OldInit: TSpeedButton;
procedure BTN_InitTapiClick(Sender: TObject);
procedure BTN_OldInitClick(Sender: TObject);
function InitTAPI : Longint;
function OldInitTAPI : Longint;
private
{ Déclarations privées }
lineApp : PHLINEAPP;
CallParams : TLineCallParams;
InitParams : TLineInitializeExParams;
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
nDevs : DWord;
TapiVers : DWord;
Vers : record
P,R : word
end absolute tapivers;
implementation
{$R *.dfm}
procedure CallBackFct (hDevice, dwMessage, dwInstance,
dwParam1, dwParam2, dwParam3: Longint);
begin
end;
function TFORM1.InitTAPI;
begin
TapiVers := $00030001;
FillChar(InitParams, 0, SIZEOF(InitParams));
with InitParams do
begin
dwTotalSize := SIZEOF(InitParams);
dwOptions := LINEINITIALIZEEXOPTION_USEHIDDENWINDOW
end;
InitTAPI := lineInitializeEx(lineApp, HInstance,
@CallBackFct, nil, nDevs, TapiVers, InitParams);
end;
function TForm1.OldInitTAPI;
begin
FillChar(CallParams, sizeof(CallParams), 0);
with CallParams do
begin
dwTotalSize := sizeof(CallParams);
dwBearerMode := LINEBEARERMODE_VOICE;
dwMediaMode := LINEMEDIAMODE_INTERACTIVEVOICE;
end;
OldInitTAPI := lineInitialize(lineApp, HInstance, @CallBackFct, nil, nDevs)
end;
procedure TForm1.BTN_InitTapiClick(Sender: TObject);
begin
with TapiInform.Lines do
begin
Clear;
add('Code erreure : ' + inttohex(InitTAPI, 8));
add('TAPI Version : ' +IntTostr(Vers.P)+'.'+IntTostr(Vers.P));
Add('Nombre des Devices : '+ IntToStr(nDevs));
end
end;
procedure TForm1.BTN_OldInitClick(Sender: TObject);
begin
with TapiInform.Lines do
begin
Clear;
add('Code erreure : ' + inttohex(OldInitTAPI, 8));
Add('Nombre des Devices : '+ IntToStr(nDevs))
end
end;
end.