高分征求修改程序(300分)

  • 主题发起人 主题发起人 billru
  • 开始时间 开始时间
B

billru

Unregistered / Unconfirmed
GUEST, unregistred user!
哪位高手能帮我把下面划线部分的VB过程改成DELPHI过程。
这是一段控制ZEBRA标签打印机的过程,其中GETFONTHEX是DLL函数。
Private Sub Command1_Click()
Dim MAX_BUFFER As Integer, nCount As Integer
Dim cBuf As String * 21000
Dim I As Integer

nCount = GETFONTHEX("钙奶片", "宋体", "chnstr01", 0, 50, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc

nCount = GETFONTHEX("金额(¥)", "宋体", "chnstr02", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("三联商业公司", "宋体", "chnstr03", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc
nCount = GETFONTHEX("银座超市", "宋体", "chnstr04", 0, 40, 0, 1, 0, cBuf)
Printer.Print Mid(cBuf, 1, nCount)
Printer.EndDoc

Printer.Print "^XA^LH10,10"
Printer.Print "^FO100,20^XGchnstr01,1,1^FS"
Printer.Print "^FO20,100^BEN,60,Y,N^FD123456789012^FS"
Printer.Print "^FO50,200^XGchnstr02,1,1^FS"
Printer.Print "^FO250,200^A040,40^FD2.20^FS"
Printer.Print "^FO50,250^XGchnstr03,1,1^FS"
Printer.Print "^FO50,300^XGchnstr04,1,1^FS"
Printer.Print "^PQ1^FS"
Printer.Print "^XZ"
Printer.EndDoc

End Sub
 
var
MAX_BUFFER:integer;
ncount:integer;
cbuf:array[0..21000] of Char;
i:integer;
begin
ncount:=GETFONTHEX("钙奶片", "宋体", "chnstr01", 0, 50, 0, 1, 0, cBuf);
Printer.begin
Doc;
Printer.Canvas.TextRect(Rect(200,200,PageWidth-200,PageHeight-200),
200, 200, copy(string(cbuf),1,ncount));
Printer.EndDoc;
end;
 
liqunxin的方法就可以了!
 
其实我早已解决
 
哪个DLL啊!给我一份吧!?
wsqrock@sina.com
 
后退
顶部