資源簡介
二維碼仿真,可以直接用來調(diào)試或者仿真,都實用的。
代碼片段和文件信息
//?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
//從根據(jù)用戶設(shè)置的邏輯設(shè)備名從相應(yīng)配置文件或注冊表中讀取通訊設(shè)置參數(shù)
//從GRGDTATM_CommCfg.ini配置表中讀取信息
int?WINAPI?iSetCommPara(tDevReturn*?p_psStatus)
{
//1
#if?DEBUG
AfxMessageBox(“Set“);
#endif
memset(p_psStatus?0?sizeof(tDevReturn));
return?SUCCESS;
}
//初始化條碼掃描儀
//參數(shù)1:[in]是否在掃描條碼時返回條碼類型,TRUE為返回條碼類型,F(xiàn)ALSE為不返回
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);
//讀取數(shù)據(jù)時?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
評論
共有 條評論