Thank you, Semen and Edwin -- that works!
------------------
Announcement
Collapse
No announcement yet.
GetTextExtentPoint32
Collapse
X
-
Guest replied
-
-
+++
And you don't need to specify the Chr$( 0 )
PB does that for you..
Don't do: Text$ & Chr$( 0 )
------------------
[email protected]
Leave a comment:
-
-
Dieny --
the second parameter should be Asciiz.
I guess that tx$ is declared as string.
If so, you should use ByCopy tx$ or ByVal StrPtr(tx$)
When you use a$ + b$, compiler converts according declaration automatic. That's why tx$ + CHR$(0) is accepted.
------------------
Leave a comment:
-
-
GetTextExtentPoint32
The Windows API HELP states, in connection with GetTextExtentPoint32,
that --
lpString
Points to the string of text. The string does not need to be zero-terminated, since cbString specifies the length of the string.
This line of code works:
Call GetTextExtentPoint32 (hDC&, tx$+Chr$(0), Len(tx$), apiSz)
If the Chr$(0) is removed, PowerBasic reports a compile time error
about "parameter mismatch". Anyone know of a reason for this?
------------------
Tags: None
-
Leave a comment: