资源简介
二维码仿真,可以直接用来调试或者仿真,都实用的。
代码片段和文件信息
// BarcodeScannerDev.cpp : Defines the initialization routines for the DLL.
//
#include “stdafx.h“
#include “BarcodeScannerDev.h“
#include “windows.h“
#include
#include “image.h“
#define DEBUG 0
//从根据用户设置的逻辑设备名从相应配置文件或注册表中读取通讯设置参数
//从GRGDTATM_CommCfg.ini配置表中读取信息
int WINAPI iSetCommPara(tDevReturn* p_psStatus)
{
//1
#if DEBUG
AfxMessageBox(“Set“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
//初始化条码扫描仪
//参数1:[in]是否在扫描条码时返回条码类型,TRUE为返回条码类型,FALSE为不返回
int WINAPI iInit(BOOL p_bGetBarcodeType tDevReturn* p_psStatus)
{
//2
#if DEBUG
AfxMessageBox(“Init“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
int WINAPI iScan(BYTE* p_pbyRecvData
UINT& p_uiRecvLength
const UINT p_uiRevWaitTime
tDevReturn *p_psStatus)
{
//返回的条形码
char t_pbyRecvData[] = “r6902538005141“;
memcpy(p_pbyRecvData t_pbyRecvData sizeof(t_pbyRecvData));
p_uiRecvLength = sizeof(t_pbyRecvData);
//读取数据时 2
#if DEBUG
AfxMessageBox(“Scan“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
int WINAPI iGetVersion(char *p_pcVersion)
{
//5
char t_iVersion[] = “V1.0.0b4“;
memcpy(p_pcVersion t_iVersion sizeof(t_iVersion));
#if DEBUG
AfxMessageBox(“iGetVersion“);
#endif
return SUCCESS;
}
int WINAPI iGetStatus(tDevReturn *p_psStatus)
{
//3
#if DEBUG
AfxMessageBox(“GetStatus“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
int WINAPI iGetDevVersion(char *p_pcDevVersion
UINT &p_uiVersionLen
tDevReturn *p_psStatus)
{
char t_pcDevVersion[] = “V1.1.0.0“;
memcpy(p_pcDevVersion t_pcDevVersion sizeof(t_pcDevVersion));
p_uiVersionLen = sizeof(t_pcDevVersion);
//4
#if DEBUG
AfxMessageBox(“GetDevVersion“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
int WINAPI iGetDevType(char *p_pcDevType
UINT &p_uiTypeLen
tDevReturn *p_psStatus)
{
char t_pcDevType[] = “123456“;
memcpy(p_pcDevType t_pcDevType sizeof(t_pcDevType));
p_uiTypeLen = sizeof(t_pcDevType);
#if DEBUG
AfxMessageBox(“GetDevType“);
#endif
memset(p_psStatus 0 sizeof(tDevReturn));
return SUCCESS;
}
void WINAPI vGetLogicalDevName(char *p_pcLogicalDevName)
{
char t_pcLogicalDevName[] = “BarcodeScanner“;
memcpy(p_pcLogicalDevName t_pcLogicalDevName sizeof(t_pcLogicalDevName));
#if DEBUG
AfxMessageBox(“GetLogicalDevName“);
#endif
}
void WINAPI vSetLogicalDevName(const char *p_pcLogicalDevName)
{
#if DEBUG
AfxMessageBox(“SetLogicalDevName“);
#endif
}
int WINAPI iGetErrorFlag()
{
#if DEBUG
AfxMessageBox(“GetErrorFlag“);
#endif
return SUCCESS;
}
tDevReturn WINAPI tGetErrorFlag()
{
tDevReturn DevReturn;
#if DEBUG
AfxMessageBox(“tGetErrorFlag“);
#endif
memset(&DevReturn 0 sizeof(tDevReturn));
return DevReturn;
}
int WINAPI iCloseC
评论
共有 条评论