| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- // mod_HSPScanner.cpp : 定义 DLL 应用程序的导出函数。
- //
- #include "stdafx.h"
- #include "mod_HSPScanner.h"
- #include "fileutil.h"
- void CHSPScannerServerSession::Handle_StartPreview(SpReqAnsContext<HSPScannerService_StartPreview_Req,
- HSPScannerService_StartPreview_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->Preview(ctx);
- }
- void CHSPScannerServerSession::Handle_CancelPreview(SpReqAnsContext<HSPScannerService_CancelPreview_Req,
- HSPScannerService_CancelPreview_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->CancelPreview(ctx);
- }
- void CHSPScannerServerSession::Handle_ScanImage(SpReqAnsContext<HSPScannerService_ScanImage_Req,
- HSPScannerService_ScanImage_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ScanImage(ctx);
- }
- void CHSPScannerServerSession::Handle_ScanImageEx(SpReqAnsContext<HSPScannerService_ScanImageEx_Req,
- HSPScannerService_ScanImageEx_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ScanImageEx(ctx);
- }
- void CHSPScannerServerSession::Handle_SetProperty(SpReqAnsContext<HSPScannerService_SetProperty_Req,
- HSPScannerService_SetProperty_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->SetProperty(ctx);
- }
- void CHSPScannerServerSession::Handle_SetWinPos(SpReqAnsContext<HSPScannerService_SetWinPos_Req,
- HSPScannerService_SetWinPos_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->SetWinPos(ctx);
- }
- void CHSPScannerServerSession::Handle_ShowProperty(SpReqAnsContext<HSPScannerService_ShowProperty_Req, HSPScannerService_ShowProperty_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->ShowProperty(ctx);
- }
- void CHSPScannerServerSession::Handle_GetDevStatus(SpReqAnsContext<HSPScannerService_GetDevStatus_Req,
- HSPScannerService_GetDevStatus_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevStatus(ctx);
- }
- void CHSPScannerServerSession::Handle_GetDevInfo(SpReqAnsContext<HSPScannerService_GetDevInfo_Req,
- HSPScannerService_GetDevInfo_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevInfo(ctx);
- }
- void CHSPScannerServerSession::Handle_Exit(SpOnewayCallContext<HSPScannerService_Exit_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->Exit(ctx);
- }
- #if defined(_MSC_VER)
- ErrorCodeEnum CHSPScannerEntity::CustomVendorLibInfo()
- {
- if (vendorLibInfo.strVendor.Compare("keba", true) == 0
- && ((vendorLibInfo.strVersion == "7" && vendorLibInfo.strBatch == "1")
- || (vendorLibInfo.strVersion == "1" && vendorLibInfo.strBatch == "1"))) {
- CSimpleStringA strExistDriver(true);
- BOOL isNewOne(FALSE);
- if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.4\\bin\\eloamDll.dll";
- isNewOne = TRUE;
- } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files\\eloamDll_2.4\\bin\\eloamDll.dll";
- isNewOne = TRUE;
- } else if (ExistsFileA("C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files (x86)\\eloamDll_2.3\\bin\\eloamDll.dll";
- } else if (ExistsFileA("C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll")) {
- strExistDriver = "C:\\Program Files\\eloamDll_2.3\\bin\\eloamDll.dll";
- }
- if (!strExistDriver.IsNullOrEmpty()) {
- CSmartPointer<IConfigInfo> spConfig;
- GetFunction()->OpenConfig(Config_CenterSetting, spConfig);
- CSimpleStringA strDepDirPath(true);
- GetFunction()->GetPath("Dep", strDepDirPath);
- strDepDirPath += "\\";
- strDepDirPath += "HSPScanner.keba.7.2.dll";
- if (ExistsFileA(strDepDirPath)) {
- int value(0);
- spConfig->ReadConfigValueInt(GetEntityName(), "KebaAdapterSwitch", value);
- if (value == 0) {
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_HSPS_VENDORDLL_KEBA_MATCHED, strExistDriver);
- } else {
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_HSPS_VENDORDLL_CHANGE, strDepDirPath);
- vendorLibInfo.strVersion = "7";
- vendorLibInfo.strBatch = "2";
- }
- }
- }
- }
- return Error_Succeed;
- }
- #endif //_MSC_VER
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CHSPScannerEntity)
- SP_END_ENTITY_MAP()
|