Information générale
Catégorie:
Fonctions Windows API
Titre:
DrawText format problems
Versions des environnements
I am trying to keep all of the parameters for the DrawText function in a table. I have a column name txt_format in which I keep defined constants for the DrawText function.
* Text format
#define TEXT_CEN 1 &&0x001
#define TEXT_BREAK 16 &&0x0010
#define TEXT_LEFT 0 &&0x000
#define TEXT_RIGHT 2 &&0x004
SET FILTER TO fg.form = 'Fee Permit' AND fg.page = 2 AND fg.graphic = 'Text' AND fg.descript = 'Misc bold'
GO top
lcFont = ALLTRIM(fg.font)
Hfont = CreateFont(fg.txt_ht * 0,0,0,fg.txt_wt,0,0,0,0,0,0,2,16,"&lcfont.")
*SetTextAlign(.hDC, fg.txt_allign)
SelectObject(.hDC,Hfont)
SCAN
lcFormat = ALLTRIM(fg.txt_format) && TEXT_LEFT coming in from the table.
lnFormat = &lcFormat
lcText = fg.text
lnLen = LEN(lcText)
SetRect(@txtbox, fg.upleftx * lnxscale, fg.uplefty * lnyscale, fg.lowrtx * lnxscale, fg.lowrty * lnyscale)
apierror = DrawText(.hDC, lcText, lnLen, txtbox, &lnFormat.)
ENDSCAN
The substitution for the lnFormat variable is not working. It is not being set the the numeric value of the constant. What am I doing wrong?
Thank you in advance.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement