This function translates the specified address into a dialable string format.
At a Glance
Header file: | Tapi.h |
Windows CE versions: | 1.0 and later |
Syntax
LONG lineTranslateAddress(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, LPCTSTR lpszAddressIn, DWORD dwCard, DWORD dwTranslateOptions, LPLINETRANSLATEOUTPUT lpTranslateOutput);
Parameters
hLineApp
[in] Application handle returned by lineInitialize. If an application has not yet called the lineInitialize function, it can set the hLineApp parameter to NULL.
dwDeviceID
[in] Specifies the device identifier for the line device upon which the call is intended to be dialed, so that variations in dialing procedures on different lines can be applied to the translation process.
dwAPIVersion
[in] Specifies the highest version of TAPI supported by the application (not necessarily the value negotiated by lineNegotiateAPIVersion on some particular line device).
lpszAddressIn
[in] Pointer to a null-terminated string that contains the address from which the data is to be extracted for translation. Must be in either the canonical address format, or an arbitrary string of dialable digits (non-canonical). This parameter must not be NULL. If the AddressIn contains a subaddress or name field, or additional addresses separated from the first address by ASCII CR and LF characters, only the first address is translated, and the remainder of the string is returned to the application without modification.
dwCard
[in] Unsupported; set to zero.
dwTranslateOptions
[in] Specifies the associated operations to be performed prior to the translation of the address into a dialable string. This parameter uses the following LINETRANSLATEOPTION_ constants:
Value | Description |
LINETRANSLATEOPTION_CARDOVERRIDE | If this bit is set, dwCard specifies the permanent identifier of a Card entry in the [Cards] section in the registry (as obtained from lineTranslateCaps) that should be used instead of the PreferredCardID specified in the definition of the CurrentLocation. It does not cause the PreferredCardID parameter of the current Location entry in the registry to be modified; the override applies only to the current translation operation. The dwCard parameter is ignored if the CARDOVERRIDE bit is not set. |
LINETRANSLATEOPTION_CANCELCALLWAITING | Ignored. A user runs a Control Panel application to specify whether a Cancel Call Waiting string is appropriate for the location. A Cancel Call Waiting string is commonly used by data modem and fax applications to prevent interruption of calls by call waiting beeps. |
LINETRANSLATEOPTION_FORCELOCAL | If the number is local but would have been translated as a long distance call (LINETRANSLATERESULT_INTOLLLIST bit set in the LINETRANSLATEOUTPUT structure), this option forces it to be translated as local. This is a temporary override of the toll list setting. |
LINETRANSLATEOPTION_FORCELD | If the address could potentially have been a toll call, but would have been translated as a local call (LINETRANSLATERESULT_NOTINTOLLLIST bit set in the LINETRANSLATEOUTPUT structure), this option forces it to be translated as long distance. This is a temporary override of the toll list setting. |
Note If you have set the LINETRANSLATEOPTION_CANCELCALLWAITING bit, it is also advisable to set the LINECALLPARAMFLAGS_SECURE bit in the dwCallParamFlags member of the LINECALLPARAMS structure (passed in to lineMakeCall through the lpCallParams parameter). This prevents the line device from using dialable digits to suppress call interrupts.
lpTranslateOutput
[out] Pointer to an application-allocated memory area to contain the output of the translation operation, of type LINETRANSLATEOUTPUT. Prior to calling lineTranslateAddress, the application should set the dwTotalSize member of this structure to indicate the amount of memory available to TAPI for returning data.
Return Values
Zero indicates success. A negative error number indicates that an error occurred. Possible error values are as follows:
LINEERR_BADDEVICEID | LINEERR_INVALPOINTER |
LINEERR_INCOMPATIBLEAPIVERSION | LINEERR_NODRIVER |
LINEERR_INIFILECORRUPT | LINEERR_NOMEM |
LINEERR_INVALADDRESS | LINEERR_OPERATIONFAILED |
LINEERR_INVALAPPHANDLE | LINEERR_RESOURCEUNAVAIL |
LINEERR_INVALCARD | LINEERR_STRUCTURETOOSMALL |
LINEERR_INVALPARAM |
Remarks
This function does not translate multiplexed canonical addresses—that is, two canonical addresses separated by <CRLF>. Only the first address is translated. The other address(es) are ignored.
When an address is specified with a country code but without the local area code, the translation is not as expected. Instead of translating the address as a local call, the system translates the address as a long distance call with no area code. To avoid this behavior, set the LINETRANSLATEOPTION_FORCELOCAL bit or provide the area code for all addresses, including local ones.
See Also
lineInitialize, lineMakeCall, lineNegotiateAPIVersion, LINECALLPARAMS, LINETRANSLATEOUTPUT