VB6 打印机上的 Unicode 打印 [英] Unicode printing on a PRINTER in VB6

查看:37
本文介绍了VB6 打印机上的 Unicode 打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在打印机(嗯,实际上是 PDFCreator)上打印 Unicode(中文)字符串,但我得到的只是字符的 VERTICAL 打印.

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.

我使用从gdi32.dll导入的TextOutW函数:

TextOutW dest.hDC, x, y, StrConv(szText, vbUnicode), Len(szText)

如果我尝试打印0.12"(如果我打印汉字,无论如何我都会得到相同的结果),我得到

And if I try to print "0.12" (if I print Chinese characters, I get the same result anyway), I get

0
.
1
2

如果我使用 dest.Print 函数,我无法打印 Unicode.

If I use the dest.Print function, I am not able to print Unicode.

无论如何,TextOutW 在屏幕上的效果非常好.

Anyway, TextOutW works WONDERFULLY on the screen.

谁能帮我解决这个问题?

Can anyone help me solve this?

推荐答案

szText的定义是什么?它是VB6字符串吗?在这种情况下尝试

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) 

注意

  • StrPtr 不是 StrConv(... , vbUnicode)
  • Declare for TextOutW 具有 ByVal lpStringU As Long
  • StrPtr not StrConv(... , vbUnicode)
  • Declare for TextOutW has ByVal lpStringU As Long

这篇关于VB6 打印机上的 Unicode 打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆