tags:

views:

318

answers:

1

I try to use TAPI in my Delphi project.
When I use lineInitializeEx instead of lineInitialize I get an error msg like "Exception Processing Message c0000139 Parameters 168fc8 162820 75b4bf7c 75b4bf7c"
The code with lineInitializeEx is :

  var
    initPrm: TLineInitializeExParams;
  begin
    FillChar(initPrm, SizeOf(initPrm), 0);
    initPrm.dwTotalSize := SizeOf(initPrm);
    initPrm.dwOptions := LINEINITIALIZEEXOPTION_USEEVENT; // or LINEINITIALIZEEXOPTION_USEHIDDENWINDOW
    if lineInitializeEx(lineApp, HInstance, lineCallback, 'TAPI sample', nDevs, tapiVersion, initPrm) < 0 then

and definition of TLineInitializeExParams is:

TLineInitializeExParams = record
    dwTotalSize,                                    
    dwNeededSize,                                   
    dwUsedSize,                                     
    dwOptions: Longint;                             
    Handles: THandleUnion;
    dwCompletionKey: Longint;                       
  end;

When I use lineInitialize

if lineInitialize(lineApp, HInstance, lineCallback, 'TAPI sample', nDevs) < 0 then

everything is OK.

Is there any idea ?

A: 

Might be worth looking at TurboPower Async Professional, which is now open source. This is what we used to successfully implement a TAPI project.

https://sourceforge.net/projects/tpapro/

_J_
thanks for your advice. I write Win32 Service App. and I think TP Async TAPI comps. not good choice for service application. Also I couldn't find how can use TurboPower Async TAPI components via TCP, not ComPort. When I use ApdTapiDevice comp. it wants a ComPort.
SimaWB
That's because TAPI is the Telephony API and so is designed fur use with modems, which communicate via the COM Port. Of course, much of this is old technology now. For communicating via TCP/IP, use the standard Delphi TSocket components.
_J_
TAPI is very usefull for communication with PBXs. I'll use it for this. My PBX supports TAPI 2. So I want to use lineInitializeEx function. But I think I should use lineInitialize.
SimaWB
Now I've just use JEDI wrapper and lineInitializeEx function works fine. @_J_ : Thanks for your relation.
SimaWB
You're welcome.
_J_