解决增加中晶OCR后在linux的编译问题
This commit is contained in:
parent
7bb7a48095
commit
3912a9f381
|
@ -9,6 +9,7 @@
|
|||
#include "dialog_upgradefirmware.h"
|
||||
#include "dialog_updateprogress.h"
|
||||
#include "base/HGBase.h"
|
||||
#include "base/HGInc.h"
|
||||
#include "HGString.h"
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
#include <iostream>
|
||||
#include "base/HGBase.h"
|
||||
#ifdef HG_CMP_MSC
|
||||
#include <Windows.h>
|
||||
#include <atlstr.h>
|
||||
#endif
|
||||
#include <string>
|
||||
#include "base/HGUtility.h"
|
||||
|
||||
std::string getOcrPath()
|
||||
{
|
||||
std::string ocrPath;
|
||||
#ifdef HG_CMP_MSC
|
||||
HKEY hKey = NULL;
|
||||
#ifdef _WIN64
|
||||
RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\WOW6432Node\\Microtek\\Microtek OCR Engine V1", 0, KEY_QUERY_VALUE, &hKey);
|
||||
|
@ -24,12 +28,13 @@ std::string getOcrPath()
|
|||
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
#endif
|
||||
return ocrPath;
|
||||
}
|
||||
|
||||
bool createOcrPdf(const std::string &imgPath, const std::string &dstFile)
|
||||
{
|
||||
#ifdef HG_CMP_MSC
|
||||
std::string ocrPath = getOcrPath();
|
||||
if (ocrPath.empty())
|
||||
return false;
|
||||
|
@ -117,4 +122,7 @@ bool createOcrPdf(const std::string &imgPath, const std::string &dstFile)
|
|||
CloseHandle(hPipeRead);
|
||||
CloseHandle(hPipeWrite);
|
||||
return ret;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue