TAPI Calls Return LINEERR_OPERATIONUNAVAIL (162135)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows 95

This article was previously published under Q162135

SUMMARY

With the release of TAPI 2.0, the default TAPI version in TAPI.H is set to 2.0. This can cause TAPI APIs called on Windows 95 to fail, and return LINEERR_OPERATIONUNAVAIL. This can be corrected by defining TAPI_CURRENT_VERSION to set the TAPI version to 1.4 before including TAPI.H, as follows:

#define TAPI_CURRENT_VERSION 0x00010004
#include <tapi.h>

MORE INFORMATION

The TAPI 2.0 implementation on Windows NT is fully UNICODE. This means there are A (Ansi) and W (Wide Character) versions of many TAPI APIs. By default, TAPI.H shipped with the Win32 SDK Version 4.0 assumes TAPI_CURRENT_VERSION as 2.0 and resolves TAPI calls to either Ansi versions of the APIs (lineMakeCall -> lineMakeCallA) or Wide character versions (lineMakeCall -> lineMakeCallW), depending on if the UNICODE constant is defined.

However, TAPI.DLL on Windows 95 does not export either the Wide or Ansi functions. When you run an application compiled using TAPI_CURRENT_VERSION >= 2.0 on Windows 95, TAPI fails to resolve these function names and reports LINEERR_OPERATIONUNAVAIL. If you set the TAPI_CURRENT_VERSION to < 2.0, it forces the TAPI.H header file to use the non-Unicode version of the APIs.

This most commonly occurs when you compile legacy TAPI application with the Win32 SDK shipped for Windows NT version 4.0 or Visual C++ version 4.2b.

The only way to compile an application that uses TAPI 2.0 on Windows NT and TAPI 1.4 on Windows 95 is to make all TAPI calls from a DLL and have two versions of the DLL, one for TAPI 2.0 and one for TAPI 1.4.

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbprogramming kbTAPI kbusage KB162135