Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DrawText format problems
Message
From
22/03/2005 12:44:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
DrawText format problems
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00998177
Message ID:
00998177
Views:
51
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.
Next
Reply
Map
View

Click here to load this message in the networking platform