Reputation: 430
I'm trying to print a Unicode (Chinese) string on a printer (well, actually PDFCreator) but all I get is a VERTICAL print of the characters.
I use the TextOutW
function imported from gdi32.dll
:
TextOutW dest.hDC, x, y, StrConv(szText, vbUnicode), Len(szText)
And if I try to print "0.12" (if I print Chinese characters, I get the same result anyway), I get
0
.
1
2
If I use the dest.Print
function, I am not able to print Unicode.
Anyway, TextOutW
works WONDERFULLY on the screen.
Can anyone help me solve this?
Upvotes: 0
Views: 2193
Reputation: 30408
What is the definition of szText
? Is it a VB6 string? In which case try
Private Declare Function Lib "gdi32" Alias "TextOutW" ( _
ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
ByVal lpStringU As Long, ByVal nCount As Long) As Long
TextOutW dest.hDC, x, y, StrPtr(szText), Len(szText)
Note
StrPtr
not StrConv(... , vbUnicode)
Declare
for TextOutW
has ByVal lpStringU As Long
Upvotes: 1