有以下一样Delphi的代码:
var
ary_byt1: array [0..51200] of byte;
int_bufsize,int_i:integer;
str_out:string;
f_iofile:textfile;
begin
int_bufsize:=getfonthex('保税', '宋体', 0, 150, 20, 20, 0,ary_byt1); //汉字存入ary_byt1缓存中 ,黑体,旋转角度0,字体5mm,x座标20,y座标20,字形0
for int_i:=0 to int_bufsize-1 do
begin
str_out:=str_out+chr(ary_byt1[int_i]); //ary_byt1l转换为字符串
end;
assignfile(f_iofile,'C:\test.txt'); //定义端口
//assignfile(f_iofile,'lpt1'); //定义端口
rewrite(f_iofile);
writeln(f_iofile,str_out); //写(DLL示例)到缓存
closefile(f_iofile);我在VB中的代码:
Dim cbuf(51200) As Byte
Dim str As String
Dim z As Integer
nCount = getfonthex("保税", "宋体", 0, 150, 20, 20, 0, cbuf(nCount))
For z = 0 To nCount - 1
str = str & Chr(cbuf(z))
Next z
为什么VB中的str变量与Delphi中的str_out变量得到的结果不相同呢?
请各位高手指点一下,谢谢!
var
ary_byt1: array [0..51200] of byte;
int_bufsize,int_i:integer;
str_out:string;
f_iofile:textfile;
begin
int_bufsize:=getfonthex('保税', '宋体', 0, 150, 20, 20, 0,ary_byt1); //汉字存入ary_byt1缓存中 ,黑体,旋转角度0,字体5mm,x座标20,y座标20,字形0
for int_i:=0 to int_bufsize-1 do
begin
str_out:=str_out+chr(ary_byt1[int_i]); //ary_byt1l转换为字符串
end;
assignfile(f_iofile,'C:\test.txt'); //定义端口
//assignfile(f_iofile,'lpt1'); //定义端口
rewrite(f_iofile);
writeln(f_iofile,str_out); //写(DLL示例)到缓存
closefile(f_iofile);我在VB中的代码:
Dim cbuf(51200) As Byte
Dim str As String
Dim z As Integer
nCount = getfonthex("保税", "宋体", 0, 150, 20, 20, 0, cbuf(nCount))
For z = 0 To nCount - 1
str = str & Chr(cbuf(z))
Next z
为什么VB中的str变量与Delphi中的str_out变量得到的结果不相同呢?
请各位高手指点一下,谢谢!
解决方案 »
- 如何识别魔兽版本
- textbox 可编辑 判断空
- 用VB通过ADO连接Excel文件时出现 “系统不支持所选择的排序”
- 怎么打包在文件夹内的图片
- 怎样设置mshFlexGrid表头居中?
- 用sndPlaySound可不可以播放mp3,或其它格式的音乐!
- 这个应该怎么写?给点思路!
- 请教各位,VB里将存放在数据库中图形或者文件等信息读取出来后如何转变成相应文件或者图形文件
- 谁有软件安装协议和InstallShield6.22的中文语言包?
- 这句insert语句有什么错误?
- 想做一个窗体效果,MDI窗体,左面区域放树形结构,选中树中某个结点后,右面调出对应的窗体来显示。
- MDI窗体里制作侧边栏的问题
str = cbuf 'Unicode
str = strconv(cbuf, vbunicode) 'Ansi -> Unicode