Delphi开发二维条码的方法
来源:互联网 发布:如何评价龚琳娜 知乎 编辑:程序博客网 时间:2024/04/26 14:46
Delphi程序是非常优秀的开发工具,在引用二维条码控件(VC++开发)时,会遇到一些变量不对称的问题。
许多开发人员在引用EnCodePdf.dll(V10.4)(博智成软件开发)时,要注意如下几点:
1.VOID类型接口,要申明成过程
DLL中原型接口是 void SetPdfConFile (LPCTSTR confile)
在DELPHI申明为: procedure SetPdfConFile(confile: PChar) : stdcall; external "EnCodePdf.dll"
2.LPCTSR/LPCSTR变量申明成PChar或string类型
function EnPdfText (txtdata:PChar,outfile:PChar):PChar; stdcall; external"EnCodePdf.dll"
3.BSTR变量应申明为PChar,这一点特别重要,有许多人申明成string类型,导致运行报错。
function EnCodePdf (Infile:PChar,outfile:PChar):PChar; stdcall; external "EnCodePdf.dll"
总结正确的引用与申明如下:
function InitRead(hcallwnd:integer,pathname:PChar): integer; stdcall; external "EnCodePdf.dll"
function CloseRead(): integer;stdcall; external "EnCodePdf.dll"
procedure SetPdfConFile(confile: PChar) : stdcall; external "EnCodePdf.dll"
function EnPdfText (txtdata:PChar,outfile:PChar):PChar;stdcall; external "EnCodePdf.dll"
function EnCodePdf (Infile:PChar,outfile:PChar):PChar; stdcall; external "EnCodePdf.dll"
function MakePdf417 (txtfile:PChar,imgfile:PChar, othfile:PChar, outfile:PChar): PChar; stdcall; external "EnCodePdf.dll"
应用调用例子如下:
Pdfname:PChar;
SetQrConFile(PChar('D:\PDF417\MakeBarCode.ini'));
许多开发人员在引用EnCodePdf.dll(V10.4)(博智成软件开发)时,要注意如下几点:
1.VOID类型接口,要申明成过程
DLL中原型接口是 void SetPdfConFile (LPCTSTR confile)
在DELPHI申明为: procedure SetPdfConFile(confile: PChar) : stdcall; external "EnCodePdf.dll"
2.LPCTSR/LPCSTR变量申明成PChar或string类型
function EnPdfText (txtdata:PChar,outfile:PChar):PChar; stdcall; external"EnCodePdf.dll"
3.BSTR变量应申明为PChar,这一点特别重要,有许多人申明成string类型,导致运行报错。
function EnCodePdf (Infile:PChar,outfile:PChar):PChar; stdcall; external "EnCodePdf.dll"
总结正确的引用与申明如下:
function InitRead(hcallwnd:integer,pathname:PChar): integer; stdcall; external "EnCodePdf.dll"
function CloseRead(): integer;stdcall; external "EnCodePdf.dll"
procedure SetPdfConFile(confile: PChar) : stdcall; external "EnCodePdf.dll"
function EnPdfText (txtdata:PChar,outfile:PChar):PChar;stdcall; external "EnCodePdf.dll"
function EnCodePdf (Infile:PChar,outfile:PChar):PChar; stdcall; external "EnCodePdf.dll"
function MakePdf417 (txtfile:PChar,imgfile:PChar, othfile:PChar, outfile:PChar): PChar; stdcall; external "EnCodePdf.dll"
应用调用例子如下:
Pdfname:PChar;
SetQrConFile(PChar('D:\PDF417\MakeBarCode.ini'));
Pdfname:=EnPdfText(PChar(’福州博智成软件开发有限公司’), PChar(’c:\pdf417.bmp’));
其它Qr_Code,DataMatrix和汉息条码可以到官网取得:http://FzBozc.com
- Delphi开发二维条码的方法
- PB开发二维条码的方法
- 用DELPHI工具编制开发生成二维条码
- QRCode二维条码开发
- Delphi中打印条码的方法
- 在Delphi中打印条码的方法步骤如下
- 在Delphi中打印条码的方法步骤如下
- 在Delphi中打印条码的方法步骤如下
- 二维条码/二维码的分类
- QRCode二维条码开发(代码)_2011.05.24
- QRCode二维条码开发(代码)_2011.05.24
- Delphi中存储二维数组的方法
- Delphi,VC++,VB,C#等实现二维条码绘制
- 一维条码与二维条码的区别
- 一维条码与二维条码的码制区别
- 关于二维条码技术的思考 开篇
- 二维条码 QR code 的解码
- 生成二维条码的书签工具
- DataSnap基础
- LCD驱动程序设计
- arc
- Python中的random库
- Heterogeneous Parallel Programming(异构并行编程)学习笔记(七)
- Delphi开发二维条码的方法
- 内存泄露
- JAVA 常用总结
- 商业创新平台:Just-Eat:整合快餐预定业务,并且做集中推广
- uva 11462 Age Sort(桶式排序)
- POJ 3009 Curling 2.0
- groovy List 去除重复数据
- dut oj 1015 老师的名单(字符串也可以异或)
- linux 也可以T人