IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Delphi Discussion :

problème initialization TAPI


Sujet :

Delphi

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Futur Membre du Club
    Inscrit en
    Mai 2006
    Messages
    3
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 3
    Par défaut problème initialization TAPI
    j'essay d'initialiser la Telephony API avec les deux méthodes :
    initialize et initializeEX. Mais j'ai l'erreur 80000035 LINEERR_INVALPOINTER.
    et je n'arrive pas à comprentdre ou est le problème.

    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.

  2. #2
    Membre émérite
    Avatar de neilbgr
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2004
    Messages
    651
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2004
    Messages : 651
    Par défaut

  3. #3
    Membre émérite
    Avatar de neilbgr
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2004
    Messages
    651
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2004
    Messages : 651
    Par défaut
    Les callback windows sont en stdcall, après ça, ça devrait aller mieux. Mais c'est juste a vu de nez !

  4. #4
    Futur Membre du Club
    Inscrit en
    Mai 2006
    Messages
    3
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 3
    Par défaut Problème TAPI
    J'utilise une unité qui interface la bibliothèque TAPI (TAPI.pas) que j'ai téléchargé (Recherches avec google. les appels sont bien en stdcall.

    F1 sans résultats

    Google sans résultats

    reste les FORUMs

  5. #5
    Membre émérite
    Avatar de neilbgr
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2004
    Messages
    651
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2004
    Messages : 651
    Par défaut
    Citation Envoyé par bel76
    les appels sont bien en stdcall.
    Or :
    Citation Envoyé par bel76
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    procedure CallBackFct (hDevice, dwMessage, dwInstance,
    dwParam1, dwParam2, dwParam3: Longint);
    begin
    end;
    Je ne vois pas de stdcall.

    Je vais nettoyer mes lunettes de ce pas...

  6. #6
    Membre averti
    Inscrit en
    Avril 2005
    Messages
    19
    Détails du profil
    Informations forums :
    Inscription : Avril 2005
    Messages : 19
    Par défaut
    function TfrmMain.InitTAPI():Boolean;
    var
    AppName:array[0..20] of char;
    nAPIVersionWORD;
    begin
    Result:=true;
    lineApp := 0;
    AppName := 'IP OFFICE Project';

    LogString( 'START TO INITIALIZE TAPI' );
    with lineInit do
    begin
    dwTotalSize := sizeof( lineInit );
    dwOptions := LINEINITIALIZEEXOPTION_USEHIDDENWINDOW;
    end;
    nAPIVersion := $00020000;
    nReturn := lineInitializeEx( @lineApp , HInstance , lineCallBack , AppName ,nDevs , nAPIVersion, lineInit );
    if (nReturn < 0)
    then
    begin
    // Initialize Failed
    LogString( 'FAILED TO INITIALIZE ' + IntToHex( nReturn,8 ) + ' '
    + IntToHex( HInstance ,8 ) ) ;
    Result:= false;
    end
    else if (nDevs = 0) then
    begin
    LogString ('NO TAPI LINE DEVICES' );
    lineShutDown( lineApp );
    lineApp :=0;
    Result:= false;
    end
    else
    begin
    LogString ( 'LINEAPP:' + IntToHex( lineApp , 8 ) + ' ' +
    'INSTANCE:' + IntToHex( HInstance , 8 ) + ' ' +
    'LINE DEVICES:' + IntToHex( nDevs ,8) + ' ' +
    'TAPI VERSION:' + IntToHex( nAPIVersion , 8 ) ) ;
    // save the handle
    m_lineApp := lineApp;

    end;
    end;


    je le fait de cette façon et j'en ai aucun problème d'initialisation, tu peux tester sbien !

    si tu rencontre qq problème je suis là pour tt aides !

  7. #7
    Membre Expert
    Avatar de Lung
    Profil pro
    Analyste-programmeur
    Inscrit en
    Mai 2002
    Messages
    2 704
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Analyste-programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2002
    Messages : 2 704
    Par défaut
    L'urgent est fait, l'impossible est en cours, pour les miracles prévoir un délai. :bug: ___ "http://club.developpez.com/regles/#LIII-A"Écrivez dans un français correct !!

    C++Builder 5 - Delphi 6#2 Entreprise - Delphi 2007 Entreprise - Delphi 2010 Architecte - Delphi XE Entreprise - Delphi XE7 Entreprise - Delphi 10 Entreprise - Delphi 10.4.2 Entreprise - Delphi 11.3 Entreprise - Visual studio 2022
    OpenGL 2.1 - Oracle 10g - Paradox - Interbase (XE) - PostgreSQL (15.7)

Discussions similaires

  1. [AC-2000] Problème sur l'état initial d'un bouton bascule
    Par caesar23 dans le forum VBA Access
    Réponses: 2
    Dernier message: 01/06/2010, 10h14
  2. problème d'affichage initial
    Par bubblebe dans le forum wxPython
    Réponses: 7
    Dernier message: 23/01/2010, 23h39
  3. Réponses: 0
    Dernier message: 23/06/2008, 22h11
  4. [Restlet] Problème d'initiation
    Par zette dans le forum Frameworks Web
    Réponses: 1
    Dernier message: 07/05/2007, 14h32
  5. problème initialisation de la TAPI
    Par bel76 dans le forum API, COM et SDKs
    Réponses: 1
    Dernier message: 05/05/2006, 23h13

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo