
Huge pointers vs Far pointers
Can anybody help me with the GetCharacterPlacement() GDI32 function.?
For me it returns zero, indicating failure, and does not fill in any
of the members of the GCP_RESULTS structure that i pass to it. There
must be something that i'm not doing right.
Yitshak Kugler
in Jerusalem
Here is the code that i try to use:
dwFLI = GetFontLanguageInfo(*pDC);
gcp->lpClass[0] = (GCPCLASS_PREBOUNDRTL | GCPCLASS_HEBREW) ;
gcp->nGlyphs = lenText;
GCPrtv.dwRTV = GetCharacterPlacement(
*pDC,
aText, //char * to the string to be displayed.
lenText,
textSize.cx,
gcp,
//(dwFLI & FLI_MASK)
(GCP_REORDER | GCP_DIACRITIC | GCP_GLYPHSHAPE | GCP_LIGATE |
GCP_CLASSIN)
);
//so far this function returns 0 and does not fill in any member
//of gcp.
//I've checked that all of the above options are returned by the
//preceeding GetFontLanguageInfo() function.
//gcp is a member of myClass and defined as:
GCP_RESULTS * gcp;
//Here is how i initialize it:
gcp = (GCP_RESULTS *)new GCP_RESULTS;
gcp->lpOutString = (char *)new char[80];
memset(gcp->lpOutString,0,80);
gcp->lpOrder = (UINT *)new UINT[80];
memset(gcp->lpOrder,0,80*sizeof(UINT));
gcp->lpDx = (INT *)new INT[80];
memset(gcp->lpDx,0,80*sizeof(INT));
gcp->lpCaretPos = (INT *)new INT[80];
memset(gcp->lpCaretPos,0,80*sizeof(INT));
gcp->lpClass = (char *)new char[80];
memset(gcp->lpClass,0,80);
gcp->lpGlyphs = (unsigned short *)new UINT[80];
memset(gcp->lpGlyphs,0,80*sizeof(UINT));
gcp->nGlyphs = 0;
gcp->nMaxFit = 0;
//I've studied the three pages of information on
//GetCharPlacement (4 pages) and GCP_RESULTS(3pages)
//on the MSDN CD.
//Also i have Nadine Kano's book, Developing International Software.
Thanks in advance for any pointers or help.
Yitshak Kugler