| 发表于:2007-10-18 18:50:29 楼主 |
有以下一样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变量得到的结果不相同呢? 请各位高手指点一下,谢谢! |
|
|
|
|