beautypg.com

HP NonStop G-Series User Manual

Page 90

background image

Data Conversion Library

Data Conversion

6–4

110838 Tandem Computers Incorporated

The Tandem DDE Gateway data conversion functions and related constants are
defined in the C language header file TDMGW.H, which is located in the EXTEND\
subdirectory. If you are using the C language, then link using the DATACONV.LIB
import library, which is also located in the EXTEND\ subdirectory.

If you are not developing your client application with the C language, then generally
you will have to declare the dynamic-link library data conversion functions that you
plan to call. The syntax of declarations varies between client development tools. Start
by looking up dynamic-link library or DLL in the index of the tool’s manual. The data
conversion functions are in the file DATACONV.DLL in the GW\ subdirectory.

Also, if you are not using the C language for your client application, then you will not
be able to use the data conversion library constants (such as
TDMGW_CONV_NOT_SIGNED) as parameters. You can find the equivalent literal
values in the TDMGW.H file in the EXTEND\ subdirectory.

Note

The FAR PASCAL clause on the function prototypes is the standard for functions implemented in
Windows dynamic link libraries.

TdmgwConvCfTextToTdmAlphaNum

This function converts strings in CF_TEXT clipboard format to Tandem alphanumeric
data representation.

Note

An SQL Varchar structure consists of a 2-byte signed two's complement count, called LEN, followed by
the actual alphanumeric data.

Function Prototype

void FAR PASCAL TdmgwConvCfTextToTdmAlphaNum

(char far * lpElementValue,

in

char far * lpAlphaNum,

out

int nCString,

in

int nVarchar,

in

int nAlphaNumLength);

in

If the string pointed to by lpElementValue is longer than nAlphaNumLength
(nAlphaNumLength minus 2 for SQL Varchar data structures), then the string is
truncated at the right.

If nVarChar is 1, then the LEN part of the SQL Varchar structure pointed to by
lpAlphaNum is set to the lesser of a) the number of characters in the lpElementValue
string and b) the number of characters actually converted.

Parameters

lpElementValue

Pointer to the null character terminated string to be converted.