gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiCharString (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
LONG GpiCharString(hps, cchString, pchString)
HPS hps;           /* presentation-space handle      */
LONG cchString;    /* number of characters in string */
PCH pchString;     /* address of string to draw      */
 
The GpiCharString function draws a character string positioned at the
current position. After the function draws the string, it sets the current
position to the end of the character string.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
cchString  Specifies the number of characters in the string pointed to by
           pchString.
 
pchString  Points to the character string to be drawn.
 
Return Value
 
The return value is GPI_OK or GPI_HITS if the function is successful (it is
GPI_HITS if the detectable attribute is set for the presentation space and a
correlation hit occurs). The return value is GPI_ERROR if an error occurs.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_FONT_AND_MODE_MISMATCH
     PMERR_INV_HPS
     PMERR_INV_LENGTH_OR_COUNT
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiCharString function to draw the string "Hello". The
GpiMove function moves the current position to (100,100) so that the string
starts there.
 
HPS hps;
POINTL ptlStart;
 
ptlStart.x = 100L;
ptlStart.y = 100L;
 
/* Start string at (100, 100). */
 
GpiMove(hps, &ptlStart);
 
/* Draw the 5-character string. */
 
GpiCharString(hps, 5L, "Hello");
 
See Also
 
GpiCharStringAt, GpiCharStringPos