Platform SDK: TAPI

tapiGetLocationInfo

The tapiGetLocationInfo function returns the country code and city (area) code that the user has set in the current location parameters in the Telephony Control Panel. The application can use this information to assist the user in forming proper canonical telephone numbers, such as by offering these as defaults when new numbers are entered in a phone book entry or database record.

LONG WINAPI tapiGetLocationInfo(
  LPSTR lpszCountryCode,  
  LPSTR lpszCityCode  
);

Parameters

lpszCountryCode
A pointer to a memory location where a null-terminated string specifying the country code for the current location is to be returned. The application should allocate at least 8 bytes of storage at this location to hold the string (TAPI does not return more than 8 bytes, including the terminating NULL). An empty string (\0) is returned if the country code has not been set for the current location.
lpszCityCode
A pointer to a memory location where a null-terminated string specifying the city (area) code for the current location is to be returned. The application should allocate at least 8 bytes of storage at this location to hold the string (TAPI does not return more than 8 bytes, including the terminating NULL). An empty string (\0) is returned if the city code has not been set for the current location.

Return Values

Returns zero if the request succeeds or a negative error number if an error occurs. Possible return values are TAPIERR_REQUESTFAILED.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later.
  Version: Requires TAPI 1.3 or later.
  Header: Declared in Tapi.h.
  Library: Use Tapi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on all platforms.

See Also

TAPI 2.2 Reference Overview, Assisted Telephony Services Reference