本人初学VC,手上有XZPL.dll、XZPL.lib、xzpldll.h这几个文件,需要编写一个程序调用XZPL.dll里的几个函数。只知道xzpldll.h头文件的内容,如下://XZPLDLL.H
extern "C"_declspec(dllexport) void XZPLDllVersion(void);
extern "C" _declspec(dllexport) char *Dllversion(void);
//==============================================
// 【功 能】:ZPLWinCHEx
// 【输 入】:lpZPLNAME---ZPL语言输出的DG名称
// lpOutStr ---要输出的字符串
// lpFontName--WIN字体名称
// bufSize-----给lpHexBuf分派的缓冲大小
// iRotate-----旋转角度,(顺时针)0,90,180,270
// iHeight-----字体的高dot为单位
// iWidth------字体的宽dot为单位一般为0
// iBold-------是否粗体
// iItalic-----是否斜体
// iUnderLine--是否下划线
// iStrikeOut--是否串过中线
// iInvert-----是否翻转颜色
// 【输 出】:lpHexBuf----16进制字符串
// 【返 回】:long error 错误代码(大于0为成功)
// 【适用范围】:以ZPL语言调用WIN字体输出汉字信息
// 【注意事项】:-101//创建兼容设备句柄给内存句柄失败
// -102//初始化字库句柄失败
// -103//创建BITMAP图形句柄失败
// -201//没有足够的内存
// >0//成功返回字节大小
//===============================================================extern "C" _declspec(dllexport) long ZPLWinCHEx(char* lpZPLNAME,char* lpOutStr,
char* lpFontName, char* lpHexBuf, unsigned int bufSize, int iRotate, int iHeight,int iWidth, bool iBold, bool iItalic, bool iUnderLine,bool iStrikeOut, bool iInvert);
//lpHexBuf 为64K,反回值大于0为成功extern "C" _declspec(dllexport) long ZPLWinCH(char* lpZPLNAME,char* lpOutStr, char* lpFontName, char* lpHexBuf, unsigned int bufSize, int iRotate, int iHeight);//==============================================
// 【功 能】:ZPLWinBmp
// 【输 入】:lpZPLNAME---ZPL语言输出的DG名称
// BmpFileName ---要转化的BMP文件名
// bufSize-----给lpHexBuf分派的缓冲大小
// iWScale-----图形宽度放大(100%)
// iHScale-----图形高度放大(100%)
// iRotate-----旋转角度,(顺时针)0,90,180,270
// iInvert-----是否翻转颜色
// 【输 出】:lpHexBuf----16进制字符串
// 【返 回】:long error 错误代码(大于0为成功)
// 【适用范围】:以ZPL语言输出BMP图形
// 【注意事项】:-101//创建兼容设备句柄给内存句柄失败
// -102//初始化字库句柄失败
// -103//创建BITMAP图形句柄失败
// -201//没有足够的内存
// >0//成功返回字节大小
//===================================================
extern "C" _declspec(dllexport) long ZPLWinBmp(char* lpZPLNAME,char* BmpFileName, char *lpHexBuf, unsigned int bufSize, unsigned int iWScale, unsigned int iHScale, int iRotate,bool iInvert); 希望各位高手大侠们给予指教。最好能给出详细点的方法和代码,或者发到
多谢了!!!
extern "C"_declspec(dllexport) void XZPLDllVersion(void);
extern "C" _declspec(dllexport) char *Dllversion(void);
//==============================================
// 【功 能】:ZPLWinCHEx
// 【输 入】:lpZPLNAME---ZPL语言输出的DG名称
// lpOutStr ---要输出的字符串
// lpFontName--WIN字体名称
// bufSize-----给lpHexBuf分派的缓冲大小
// iRotate-----旋转角度,(顺时针)0,90,180,270
// iHeight-----字体的高dot为单位
// iWidth------字体的宽dot为单位一般为0
// iBold-------是否粗体
// iItalic-----是否斜体
// iUnderLine--是否下划线
// iStrikeOut--是否串过中线
// iInvert-----是否翻转颜色
// 【输 出】:lpHexBuf----16进制字符串
// 【返 回】:long error 错误代码(大于0为成功)
// 【适用范围】:以ZPL语言调用WIN字体输出汉字信息
// 【注意事项】:-101//创建兼容设备句柄给内存句柄失败
// -102//初始化字库句柄失败
// -103//创建BITMAP图形句柄失败
// -201//没有足够的内存
// >0//成功返回字节大小
//===============================================================extern "C" _declspec(dllexport) long ZPLWinCHEx(char* lpZPLNAME,char* lpOutStr,
char* lpFontName, char* lpHexBuf, unsigned int bufSize, int iRotate, int iHeight,int iWidth, bool iBold, bool iItalic, bool iUnderLine,bool iStrikeOut, bool iInvert);
//lpHexBuf 为64K,反回值大于0为成功extern "C" _declspec(dllexport) long ZPLWinCH(char* lpZPLNAME,char* lpOutStr, char* lpFontName, char* lpHexBuf, unsigned int bufSize, int iRotate, int iHeight);//==============================================
// 【功 能】:ZPLWinBmp
// 【输 入】:lpZPLNAME---ZPL语言输出的DG名称
// BmpFileName ---要转化的BMP文件名
// bufSize-----给lpHexBuf分派的缓冲大小
// iWScale-----图形宽度放大(100%)
// iHScale-----图形高度放大(100%)
// iRotate-----旋转角度,(顺时针)0,90,180,270
// iInvert-----是否翻转颜色
// 【输 出】:lpHexBuf----16进制字符串
// 【返 回】:long error 错误代码(大于0为成功)
// 【适用范围】:以ZPL语言输出BMP图形
// 【注意事项】:-101//创建兼容设备句柄给内存句柄失败
// -102//初始化字库句柄失败
// -103//创建BITMAP图形句柄失败
// -201//没有足够的内存
// >0//成功返回字节大小
//===================================================
extern "C" _declspec(dllexport) long ZPLWinBmp(char* lpZPLNAME,char* BmpFileName, char *lpHexBuf, unsigned int bufSize, unsigned int iWScale, unsigned int iHScale, int iRotate,bool iInvert); 希望各位高手大侠们给予指教。最好能给出详细点的方法和代码,或者发到
多谢了!!!
#include "xzpldll.h"
#pragma comment(lib,"XZPL.lib")
就可以调用里面的函数了
在应用程序中#include "xzpldll.h"
在project->setting->link->Object/library modules中写入XZPL.lib
将xzpldll.h,XZPL.lib和XZPL.dll文件都放到你工程根目录下。记住,要将XZPL.dll文件和你的工程编译的执行程序放到同一个目录下。
然后在工程里就可以放心的使用xzpldll.h中的这些函数了。
先把DLL文件导成LIB文件之后再加入系统里,再加.H文件就可以直接用了。