Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DrawText format problems
Message
De
22/03/2005 12:44:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
DrawText format problems
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
00998177
Message ID:
00998177
Vues:
53
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
Fil
Voir

Click here to load this message in the networking platform