Unicode printing on a PRINTER in VB6

后端 未结 1 617
情话喂你
情话喂你 2021-01-29 01:29

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

相关标签:
1条回答
  • 2021-01-29 02:16

    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
    0 讨论(0)
提交回复
热议问题