gpi12.hlp (Table of Contents; Topic list)
GpiCharStringAt (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
LONG GpiCharStringAt(hps, pptlStart, cchString, pchString)
HPS hps;              /* presentation-space handle                  */
PPOINTL pptlStart;    /* address of structure for starting position */
LONG cchString;       /* number of characters in string             */
PCH pchString;        /* address of string to draw                  */
 
The GpiCharStringAt function draws a character string starting at the
specified 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.
 
pptlStart  Points to the POINTL structure that contains the starting
           position in world coordinates.
 
cchString  Specifies the number of characters 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_COORDINATE
     PMERR_INV_HPS
     PMERR_INV_LENGTH_OR_COUNT
     PMERR_PS_BUSY
 
Example
 
The example uses the GpiCharStringAt function to draw the string "Hello"
starting at the position (100,100). It then uses the GpiMove and
GpiCharString functions to draw the same string at exactly the same
position.
 
HPS hps;
POINTL ptlStart;
 
ptlStart.x = 100L;
ptlStart.y = 100L;
 
/* Draw the string "Hello" at (100, 100). */
 
GpiCharStringAt(hps, &ptlStart, 5, "Hello");
 
/* These two calls are identical to the one above. */
 
GpiMove(hps, &ptlStart);
GpiCharString(hps, 5L, "Hello");
 
See Also
 
GpiCharString, GpiMove, POINTL