├── README.md
├── UiCommTools
├── UiCommTools
│ ├── ULib.h
│ ├── resource.h
│ ├── CommTools.cpp
│ ├── UiCommTools.rc
│ ├── CDShowMessage.cpp
│ ├── CExportExcel.cpp
│ ├── UiCommTools.aps
│ ├── res
│ │ └── UiCommTools.rc2
│ ├── UiCommTools.def
│ ├── UiCommTools.vcxproj.user
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── UiCommTools.h
│ ├── CExportExcel.h
│ ├── CDShowMessage.h
│ ├── stdafx.h
│ ├── UiCommTools.cpp
│ ├── UiCommTools.vcxproj.filters
│ ├── ReadMe.txt
│ ├── CommTools.h
│ └── UiCommTools.vcxproj
└── UiCommTools.sln
├── UInterfaceLib
├── UInterfaceLib
│ ├── ULib.h
│ ├── resource.h
│ ├── CommTools.cpp
│ ├── CCFtpCtrll.cpp
│ ├── CCaptureVideo.h
│ ├── COwnerButton.h
│ ├── COwnerListBox.h
│ ├── res
│ │ ├── UI-RBAS.ico
│ │ └── UInterfaceLib.rc2
│ ├── CCProjectInfo.cpp
│ ├── CCSoftUpdate.cpp
│ ├── CCaptureVideo.cpp
│ ├── CDShowMessage.cpp
│ ├── CExportExcel.cpp
│ ├── COwnerButton.cpp
│ ├── COwnerListBox.cpp
│ ├── COwnerPicSta.cpp
│ ├── UInterfaceLib.aps
│ ├── UInterfaceLib.rc
│ ├── UOwnCtrlDefine.h
│ ├── UCommonToolsDefine.h
│ ├── UMessageDlgDefine.h
│ ├── SerialTools
│ │ ├── CCmdStation.h
│ │ ├── CSerialCom.h
│ │ ├── CSerialCom.cpp
│ │ └── CCmdStation.cpp
│ ├── export_include
│ │ ├── UInterface.h
│ │ ├── UOwnCtrlDefine.h
│ │ ├── UCommonToolsDefine.h
│ │ └── UDataBase.h
│ ├── UInterfaceLib.def
│ ├── UInterfaceLib.vcxproj.user
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── COwnerListCtrl.h
│ ├── CCSoftUpdate.h
│ ├── CCFileIni.h
│ ├── CCProjectInfo.h
│ ├── UInterfaceLib.h
│ ├── CCFtpCtrl.h
│ ├── CExportExcel.h
│ ├── CCFileXml.h
│ ├── CSqliteCtrl.h
│ ├── CCamDealData.h
│ ├── COwnerPicSta.h
│ ├── COwnerListCtrl.cpp
│ ├── CConfigBase.h
│ ├── CDShowMessage.h
│ ├── CCFileXml.cpp
│ ├── stdafx.h
│ ├── UInterfaceLib.cpp
│ ├── CCFileIni.cpp
│ ├── CDBbase.h
│ ├── mysql
│ │ ├── cppconn
│ │ │ ├── version_info.h
│ │ │ ├── datatype.h
│ │ │ ├── build_config.h
│ │ │ ├── warning.h
│ │ │ ├── parameter_metadata.h
│ │ │ ├── driver.h
│ │ │ ├── statement.h
│ │ │ ├── prepared_statement.h
│ │ │ ├── resultset_metadata.h
│ │ │ ├── config.h
│ │ │ ├── resultset.h
│ │ │ ├── exception.h
│ │ │ ├── connection.h
│ │ │ ├── sqlstring.h
│ │ │ ├── variant.h
│ │ │ └── metadata.h
│ │ ├── mysql_error.h
│ │ ├── mysql_driver.h
│ │ └── mysql_connection.h
│ ├── CCamDealData.cpp
│ ├── CDBbase.cpp
│ ├── CvvImage.h
│ ├── CConfigBase.cpp
│ ├── ReadMe.txt
│ ├── CommTools.h
│ ├── CSqliteCtrl.cpp
│ ├── excel
│ │ ├── CWorksheets.h
│ │ └── CWorkbooks.h
│ ├── CvvImage.cpp
│ ├── UInterfaceLib.vcxproj.filters
│ ├── UInterfaceLib.vcxproj
│ └── sqlite
│ │ └── CppSQLite3U.h
└── UInterfaceLib.sln
├── .gitignore
└── LICENSE
/README.md:
--------------------------------------------------------------------------------
1 | # UInterfaceLib
2 | c++工具以及mfc界面库
3 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/ULib.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/ULib.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/ULib.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/ULib.h
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/resource.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/resource.h
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CommTools.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/CommTools.cpp
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/UiCommTools.rc
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CommTools.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CommTools.cpp
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CDShowMessage.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/CDShowMessage.cpp
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CExportExcel.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/CExportExcel.cpp
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/UiCommTools.aps
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFtpCtrll.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CCFtpCtrll.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCaptureVideo.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CCaptureVideo.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerButton.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/COwnerButton.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerListBox.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/COwnerListBox.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/res/UI-RBAS.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/res/UI-RBAS.ico
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/res/UiCommTools.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UiCommTools/UiCommTools/res/UiCommTools.rc2
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCProjectInfo.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CCProjectInfo.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCSoftUpdate.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CCSoftUpdate.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCaptureVideo.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CCaptureVideo.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CDShowMessage.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CDShowMessage.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CExportExcel.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/CExportExcel.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerButton.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/COwnerButton.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerListBox.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/COwnerListBox.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerPicSta.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/COwnerPicSta.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/UInterfaceLib.aps
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/UInterfaceLib.rc
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UOwnCtrlDefine.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/UOwnCtrlDefine.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UCommonToolsDefine.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/UCommonToolsDefine.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UMessageDlgDefine.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/UMessageDlgDefine.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/res/UInterfaceLib.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/res/UInterfaceLib.rc2
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/SerialTools/CCmdStation.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/SerialTools/CCmdStation.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.cpp
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/export_include/UInterface.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/export_include/UInterface.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/export_include/UOwnCtrlDefine.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/export_include/UOwnCtrlDefine.h
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/export_include/UCommonToolsDefine.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hanbox/UInterfaceLib/HEAD/UInterfaceLib/UInterfaceLib/export_include/UCommonToolsDefine.h
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.def:
--------------------------------------------------------------------------------
1 | ; UiCommTools.def : Declares the module parameters for the DLL.
2 |
3 | LIBRARY
4 |
5 | EXPORTS
6 | ; Explicit exports can go here
7 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.def:
--------------------------------------------------------------------------------
1 | ; UInterfaceLib.def : Declares the module parameters for the DLL.
2 |
3 | LIBRARY
4 |
5 | EXPORTS
6 | ; Explicit exports can go here
7 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/stdafx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // UiCommTools.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/stdafx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // UInterfaceLib.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 | *.obj
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Compiled Dynamic libraries
12 | *.so
13 | *.dylib
14 | *.dll
15 |
16 | # Fortran module files
17 | *.mod
18 | *.smod
19 |
20 | # Compiled Static libraries
21 | *.lai
22 | *.la
23 | *.a
24 | *.lib
25 |
26 | # Executables
27 | *.exe
28 | *.out
29 | *.app
30 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerListCtrl.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "afxcmn.h"
3 | class COwnerListCtrl :
4 | public CListCtrl
5 | {
6 | public:
7 | COwnerListCtrl(void);
8 | ~COwnerListCtrl(void);
9 |
10 | protected:
11 | void SetItemHeight( int nHeight );
12 | void MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct);
13 | DWORD SetExtendedStyle( DWORD dwNewStyle );
14 |
15 | private:
16 | int m_iHeightItem;
17 | };
18 |
19 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCSoftUpdate.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CCSoftUpdate
3 | {
4 | public:
5 | CCSoftUpdate(void);
6 | ~CCSoftUpdate(void);
7 |
8 | public:
9 | CString CheckUrlLink(CString csUrl);
10 | CString UpdateCheck(CString csFilePath);
11 |
12 | protected:
13 | CCProjectInfo m_clsProIfo;
14 | CCFtpCtrl m_clsFtp;
15 |
16 | CString m_csServerPath;
17 | CString m_csLocalPath;
18 |
19 | private:
20 | CString CheckVersion(CString csFileVersion, CString csProName);
21 | };
22 |
23 |
24 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFileIni.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "cconfigbase.h"
3 |
4 | class CCFileIni :
5 | public CCFileBase
6 | {
7 | public:
8 | CCFileIni(void);
9 | ~CCFileIni(void);
10 |
11 | public:
12 | virtual int InitFile(string strPath);
13 | virtual string Get(string strA, string strB);
14 | virtual void Add(string strA, string strB, string strC);
15 | virtual void Add(vector v_stPair);
16 | virtual void WriteFile(string strPath);
17 | virtual void ClearnFile();
18 |
19 | protected:
20 | string m_strPath;
21 |
22 | private:
23 |
24 | };
25 |
26 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.h:
--------------------------------------------------------------------------------
1 | // UiCommTools.h : main header file for the UiCommTools DLL
2 | //
3 |
4 | #pragma once
5 |
6 | #ifndef __AFXWIN_H__
7 | #error "include 'stdafx.h' before including this file for PCH"
8 | #endif
9 |
10 | #include "resource.h" // main symbols
11 |
12 |
13 | // CUiCommToolsApp
14 | // See UiCommTools.cpp for the implementation of this class
15 | //
16 |
17 | class CUiCommToolsApp : public CWinApp
18 | {
19 | public:
20 | CUiCommToolsApp();
21 |
22 | // Overrides
23 | public:
24 | virtual BOOL InitInstance();
25 |
26 | DECLARE_MESSAGE_MAP()
27 | };
28 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCProjectInfo.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CCProjectInfo
3 | {
4 | public:
5 | CCProjectInfo(void);
6 | ~CCProjectInfo(void);
7 |
8 | public:
9 | bool GetPrejectInfo(CString csFilePath);
10 | CString GetVersion()
11 | {
12 | return m_csVersion;
13 | }
14 | CString GetOriginalFileName()
15 | {
16 | return m_csOriginalFileName;
17 | }
18 | CString GetProductName()
19 | {
20 | return m_csProductName;
21 | }
22 |
23 | protected:
24 | CString m_csVersion;
25 | CString m_csOriginalFileName;
26 | CString m_csProductName;
27 | CString m_csLan;
28 |
29 | private:
30 | };
31 |
32 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.h:
--------------------------------------------------------------------------------
1 | // UInterfaceLib.h : main header file for the UInterfaceLib DLL
2 | //
3 |
4 | #pragma once
5 |
6 | #ifndef __AFXWIN_H__
7 | #error "include 'stdafx.h' before including this file for PCH"
8 | #endif
9 |
10 | #include "resource.h" // main symbols
11 |
12 |
13 | // CUInterfaceLibApp
14 | // See UInterfaceLib.cpp for the implementation of this class
15 | //
16 |
17 | class CUInterfaceLibApp : public CWinApp
18 | {
19 | public:
20 | CUInterfaceLibApp();
21 |
22 | // Overrides
23 | public:
24 | virtual BOOL InitInstance();
25 |
26 | DECLARE_MESSAGE_MAP()
27 | };
28 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFtpCtrl.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | class CCFtpCtrl
6 | {
7 | public:
8 | CCFtpCtrl(void);
9 | ~CCFtpCtrl(void);
10 | int Login();
11 | int ConnectFtp(CString csAddr, CString csName, CString csPwd, CString csPort = _T("21"));
12 | void StopConnect();
13 | bool Updown(CString csSrcPath, CString csDesPath);
14 |
15 | protected:
16 | boost::shared_ptr m_pInetSession;
17 | boost::shared_ptr m_pFtpConnection;
18 | boost::shared_ptr m_pRemoteFile;
19 |
20 | private:
21 | void CloseRemoteFile();
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CExportExcel.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CExportExcel
3 | {
4 | public:
5 | CExportExcel(void);
6 | ~CExportExcel(void);
7 |
8 | public :
9 | void SetExtraNum(int iNum);
10 | void SetExportMode(int iMode);
11 |
12 | void InitExcel();
13 | void ShowExcel(CFormatData clsData);
14 | void Realease();
15 | void InitExportToExcel(CFormatData clsData);
16 |
17 | protected:
18 | CApplication m_exlApp;
19 | CWorkbook m_exlBook;
20 | CWorkbooks m_exlBooks;
21 | CWorksheet m_exlSheet;
22 | CWorksheets m_exlSheets;
23 | CRange m_exlRge;
24 | CRange m_usedRange;
25 |
26 | int m_iExtraSheetsNum;
27 | int m_iMode;
28 |
29 | private:
30 | };
31 |
32 |
33 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CExportExcel.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CExportExcel
3 | {
4 | public:
5 | CExportExcel(void);
6 | ~CExportExcel(void);
7 |
8 | public :
9 | void SetExtraNum(int iNum);
10 | void SetExportMode(int iMode);
11 |
12 | void InitExcel();
13 | void ShowExcel(CFormatData clsData);
14 | void Realease();
15 | void InitExportToExcel(CFormatData clsData);
16 |
17 | protected:
18 | CApplication m_exlApp;
19 | CWorkbook m_exlBook;
20 | CWorkbooks m_exlBooks;
21 | CWorksheet m_exlSheet;
22 | CWorksheets m_exlSheets;
23 | CRange m_exlRge;
24 | CRange m_usedRange;
25 |
26 | int m_iExtraSheetsNum;
27 | int m_iMode;
28 |
29 | private:
30 | };
31 |
32 |
33 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFileXml.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "cconfigbase.h"
3 | #include "boost/property_tree/ptree.hpp"
4 | #include
5 |
6 | using namespace boost::property_tree;
7 |
8 | class CCFileXml :
9 | public CCFileBase
10 | {
11 | public:
12 | CCFileXml(void);
13 | ~CCFileXml(void);
14 |
15 | public:
16 | virtual int InitFile(string strPath);
17 | virtual string Get(string strA, string strB);
18 | virtual void Add(string strA, string strB, string strC);
19 | virtual void Add(vector v_stPair);
20 | virtual void WriteFile(string strPath);
21 | virtual void ClearnFile();
22 |
23 | protected:
24 | ptree m_clsPt;
25 |
26 | private:
27 | };
28 |
29 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CSqliteCtrl.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | class CSqliteCtrl : public CDBCtrlBase
3 | {
4 | public:
5 | CSqliteCtrl(void);
6 | ~CSqliteCtrl(void);
7 |
8 | public:
9 | virtual int Connect(CString csHost, CString csDB, CString csName, CString csPwd);
10 | virtual int Connect(CString csDB, CString csName, CString csPwd);
11 | virtual int Close();
12 | virtual int SelectData(CFormatData &clsData, CString csDB = _T(""));
13 | virtual int CtrlData(CString csSql, CString csDB = _T(""));
14 | virtual int ClearTable(CString csTable, CString csDB = _T(""));
15 | virtual int DeleteTable(CString csTable, CString csDB = _T(""));
16 |
17 | protected:
18 | CppSQLite3DB m_db;
19 |
20 | private:
21 |
22 | };
23 |
24 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCamDealData.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ccapturevideo.h"
3 |
4 | #define VIDEO_WIDTH 640
5 | #define VIDEO_HEIGHT 480
6 |
7 | class __declspec(dllexport) CCamDealData :
8 | public CCamDataDealBase
9 | {
10 | public:
11 | CCamDealData(void);
12 | ~CCamDealData(void);
13 |
14 | public:
15 | void GrabVideoFrames(BOOL bGrabVideoFrames);
16 | HRESULT Open(int iDeviceID,HWND hWnd);
17 | HRESULT Close();
18 | int EnumDevices(HWND hList);
19 | cv::Mat SceenShot();
20 |
21 | protected:
22 | CCaptureVideo m_Cam;
23 | BYTE* m_pBuf;
24 |
25 | private:
26 | void ProcessBuf(BYTE * pBuffer, long lWidth,long lHeight);
27 | void DealCamData(BYTE * pBuffer, long lWidth,long lHeight);
28 | };
29 |
30 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerPicSta.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "afxwin.h"
3 | using namespace cv;
4 |
5 | class __declspec(dllexport) COwnerPicSta : public CStatic
6 | {
7 | public:
8 | COwnerPicSta(void);
9 | ~COwnerPicSta(void);
10 | void LoadImage(Mat img, int iMethod = 1);
11 | void LoadImage(CString csPath, int iMethod = 1);
12 | cv::Mat GetImage();
13 | CString GetImagePath()
14 | {
15 | return m_csPath;
16 | }
17 | void SetID(int iID)
18 | {
19 | m_iID = iID;
20 | }
21 |
22 | public:
23 | afx_msg void OnPaint();
24 | afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
25 |
26 | protected:
27 | DECLARE_MESSAGE_MAP()
28 | cv::Mat m_Image;
29 | CRect m_Rect;
30 | CString m_csPath;
31 |
32 | int m_iID;
33 |
34 | private:
35 | void ResizeImage(Mat &img,CRect rect,Mat &dst_img,int method);
36 | };
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UiCommTools", "UiCommTools\UiCommTools.vcxproj", "{9E755AE8-5466-40C7-8670-8E18FF30B3D8}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {9E755AE8-5466-40C7-8670-8E18FF30B3D8}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {9E755AE8-5466-40C7-8670-8E18FF30B3D8}.Debug|Win32.Build.0 = Debug|Win32
14 | {9E755AE8-5466-40C7-8670-8E18FF30B3D8}.Release|Win32.ActiveCfg = Release|Win32
15 | {9E755AE8-5466-40C7-8670-8E18FF30B3D8}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UInterfaceLib", "UInterfaceLib\UInterfaceLib.vcxproj", "{3709FFBE-3A6F-45E3-87A6-6D7421E380DD}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {3709FFBE-3A6F-45E3-87A6-6D7421E380DD}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {3709FFBE-3A6F-45E3-87A6-6D7421E380DD}.Debug|Win32.Build.0 = Debug|Win32
14 | {3709FFBE-3A6F-45E3-87A6-6D7421E380DD}.Release|Win32.ActiveCfg = Release|Win32
15 | {3709FFBE-3A6F-45E3-87A6-6D7421E380DD}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/COwnerListCtrl.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "COwnerListCtrl.h"
3 |
4 |
5 | COwnerListCtrl::COwnerListCtrl(void)
6 | {
7 | m_iHeightItem = 20;
8 | }
9 |
10 |
11 | COwnerListCtrl::~COwnerListCtrl(void)
12 | {
13 | }
14 |
15 | void COwnerListCtrl::SetItemHeight( int nHeight )
16 | {
17 | m_iHeightItem = nHeight;
18 | CRect rcWin;
19 | GetWindowRect(&rcWin);
20 | WINDOWPOS wp;
21 | wp.hwnd = m_hWnd;
22 | wp.cx = rcWin.Width();
23 | wp.cy = rcWin.Height();
24 | wp.flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER;
25 | SendMessage(WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
26 | }
27 |
28 | void COwnerListCtrl::MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct)
29 | {
30 | if (m_iHeightItem > 0)
31 | {
32 | lpMeasureItemStruct->itemHeight = m_iHeightItem;
33 | }
34 | }
35 |
36 | DWORD COwnerListCtrl::SetExtendedStyle( DWORD dwNewStyle )
37 | {
38 | if ( dwNewStyle & LVS_EX_CHECKBOXES )
39 | {
40 | dwNewStyle &=~LVS_EX_CHECKBOXES;
41 | dwNewStyle &=~LVS_EX_GRIDLINES;
42 | }
43 | return __super::SetExtendedStyle(dwNewStyle);
44 | }
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 HanBox2016
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CConfigBase.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define ULIB_FILE_TYPE_XML 1
4 | #define ULIB_FILE_TYPE_INI 2
5 | #define ULIB_FILE_TYPE_JSON 3
6 |
7 | struct STPAIR
8 | {
9 | string strTitle;
10 | string strA;
11 | string strB;
12 | };
13 |
14 | class CCFileBase
15 | {
16 | public:
17 | CCFileBase(){}
18 | ~CCFileBase(){}
19 |
20 | public:
21 | virtual int InitFile(string strPath) = 0;
22 | virtual string Get(string strA, string strB) = 0;
23 | virtual void Add(string strA, string strB, string strC) = 0;
24 | virtual void Add(vector v_stPair) = 0;
25 | virtual void WriteFile(string strPath) = 0;
26 | virtual void ClearnFile() = 0;
27 |
28 | protected:
29 | string m_strPath;
30 |
31 | private:
32 |
33 | };
34 |
35 | class CConfigBase
36 | {
37 | public:
38 | CConfigBase(void);
39 | ~CConfigBase(void);
40 |
41 | public:
42 | int LoadConfig(string strPath, vector &v_stPair);
43 | int SaveConfig(string strPath, vector v_stPair);
44 | boolean SetFileType(int iType);
45 |
46 | protected:
47 | boost::shared_ptr m_pFile;
48 | string m_strPath;
49 | int m_iType;
50 |
51 | private:
52 |
53 | };
54 |
55 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CDShowMessage.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "afxdialogex.h"
3 | // CDShowMessage dialog
4 |
5 | class CDShowMessage : public CDialogEx
6 | {
7 | DECLARE_DYNAMIC(CDShowMessage)
8 |
9 | public:
10 | CDShowMessage(CWnd* pParent = NULL); // standard constructor
11 | virtual ~CDShowMessage();
12 |
13 | // Dialog Data
14 | enum { IDD = IDD_DLG_SHOWMESSAGE };
15 |
16 | public:
17 | void ShowMessage(CString csMessage, int iMode);
18 | void SetTitle(CString csTitle)
19 | {
20 | this->m_csTitle = csTitle;
21 | }
22 |
23 | virtual BOOL OnInitDialog();
24 | afx_msg void OnMenuShowmessageClearn();
25 | afx_msg void OnPaint();
26 | virtual BOOL PreTranslateMessage(MSG* pMsg);
27 | afx_msg void OnMenuCopy();
28 | afx_msg LRESULT ShowMessage(WPARAM wParam, LPARAM lParam);
29 | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
30 | afx_msg void OnMenuMessageShowmessage();
31 |
32 | protected:
33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
34 |
35 | DECLARE_MESSAGE_MAP()
36 | COwnerListBox m_List;
37 | CString m_csTitle;
38 | HMENU m_hMenu;
39 | CString m_csMessage;
40 | CFont m_font;
41 | int m_iBGChange;
42 |
43 | private:
44 | void DealRMenu(CListBox *pList);
45 | void CopyMessage();
46 | };
47 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CDShowMessage.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "afxdialogex.h"
3 | // CDShowMessage dialog
4 |
5 | class CDShowMessage : public CDialogEx
6 | {
7 | DECLARE_DYNAMIC(CDShowMessage)
8 |
9 | public:
10 | CDShowMessage(CWnd* pParent = NULL); // standard constructor
11 | virtual ~CDShowMessage();
12 |
13 | // Dialog Data
14 | enum { IDD = IDD_DLG_SHOWMESSAGE };
15 |
16 | public:
17 | void ShowMessage(CString csMessage, int iMode);
18 | void SetTitle(CString csTitle)
19 | {
20 | this->m_csTitle = csTitle;
21 | }
22 |
23 | virtual BOOL OnInitDialog();
24 | afx_msg void OnMenuShowmessageClearn();
25 | afx_msg void OnPaint();
26 | virtual BOOL PreTranslateMessage(MSG* pMsg);
27 | afx_msg void OnMenuCopy();
28 | afx_msg LRESULT ShowMessage(WPARAM wParam, LPARAM lParam);
29 | afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
30 | afx_msg void OnMenuMessageShowmessage();
31 |
32 | protected:
33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
34 |
35 | DECLARE_MESSAGE_MAP()
36 | COwnerListBox m_List;
37 | CString m_csTitle;
38 | HMENU m_hMenu;
39 | CString m_csMessage;
40 | CFont m_font;
41 | int m_iBGChange;
42 |
43 | private:
44 | void DealRMenu(CListBox *pList);
45 | void CopyMessage();
46 | };
47 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFileXml.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CCFileXml.h"
3 |
4 |
5 | CCFileXml::CCFileXml(void)
6 | {
7 | }
8 |
9 |
10 | CCFileXml::~CCFileXml(void)
11 | {
12 | }
13 |
14 | int CCFileXml::InitFile(string strPath)
15 | {
16 | int iRet = 0;
17 |
18 | string strError = "";
19 | if ( CCommTools::GetInstance()->file_exist(strPath, strError) == ULIB_RETURN_FALSE )
20 | {
21 | std::ofstream file(strPath);
22 | }
23 |
24 | boost::property_tree::read_xml(strPath, m_clsPt);
25 | m_strPath = strPath;
26 |
27 | return iRet;
28 | }
29 |
30 | string CCFileXml::Get(string strA, string strB)
31 | {
32 | string strC = "";
33 |
34 | ptree ptChild = m_clsPt.get_child(strA);
35 | strC = ptChild.get(strB);
36 |
37 | ptChild.clear();
38 |
39 | return strC;
40 | }
41 |
42 | void CCFileXml::Add(string strA, string strB, string strC)
43 | {
44 | ptree ptChild;
45 | ptChild.put(strB, strC);
46 | m_clsPt.add_child(strA, ptChild);
47 | }
48 |
49 | void CCFileXml::Add( vector v_stPair )
50 | {
51 | ptree ptChild;
52 | for ( int i = 0; i < v_stPair.size(); i++ )
53 | {
54 | ptChild.put(v_stPair[i].strA, v_stPair[i].strB);
55 | }
56 | m_clsPt.add_child(v_stPair[0].strTitle, ptChild);
57 | }
58 |
59 | void CCFileXml::WriteFile(string strPath)
60 | {
61 | write_xml(strPath, m_clsPt);
62 | }
63 |
64 | void CCFileXml::ClearnFile()
65 | {
66 | m_clsPt.clear();
67 | }
68 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/stdafx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 |
5 | #pragma once
6 |
7 | #ifndef VC_EXTRALEAN
8 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
9 | #endif
10 |
11 | #include "targetver.h"
12 |
13 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
14 |
15 | #include // MFC core and standard components
16 | #include // MFC extensions
17 |
18 | #ifndef _AFX_NO_OLE_SUPPORT
19 | #include // MFC OLE classes
20 | #include // MFC OLE dialog classes
21 | #include // MFC Automation classes
22 | #endif // _AFX_NO_OLE_SUPPORT
23 |
24 | #ifndef _AFX_NO_DB_SUPPORT
25 | #include // MFC ODBC database classes
26 | #endif // _AFX_NO_DB_SUPPORT
27 |
28 | #ifndef _AFX_NO_DAO_SUPPORT
29 | #include // MFC DAO database classes
30 | #endif // _AFX_NO_DAO_SUPPORT
31 |
32 | #ifndef _AFX_NO_OLE_SUPPORT
33 | #include // MFC support for Internet Explorer 4 Common Controls
34 | #endif
35 | #ifndef _AFX_NO_AFXCMN_SUPPORT
36 | #include // MFC support for Windows Common Controls
37 | #endif // _AFX_NO_AFXCMN_SUPPORT
38 |
39 | #include "ULib.h"
40 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/stdafx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 |
5 | #pragma once
6 |
7 | #ifndef VC_EXTRALEAN
8 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
9 | #endif
10 |
11 | #include "targetver.h"
12 |
13 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
14 |
15 | #include // MFC core and standard components
16 | #include // MFC extensions
17 |
18 | #ifndef _AFX_NO_OLE_SUPPORT
19 | #include // MFC OLE classes
20 | #include // MFC OLE dialog classes
21 | #include // MFC Automation classes
22 | #endif // _AFX_NO_OLE_SUPPORT
23 |
24 | //#ifndef _AFX_NO_DB_SUPPORT
25 | //#include // MFC ODBC database classes
26 | //#endif // _AFX_NO_DB_SUPPORT
27 | //
28 | //#ifndef _AFX_NO_DAO_SUPPORT
29 | //#include // MFC DAO database classes
30 | //#endif // _AFX_NO_DAO_SUPPORT
31 |
32 | #ifndef _AFX_NO_OLE_SUPPORT
33 | #include // MFC support for Internet Explorer 4 Common Controls
34 | #endif
35 | #ifndef _AFX_NO_AFXCMN_SUPPORT
36 | #include // MFC support for Windows Common Controls
37 | #endif // _AFX_NO_AFXCMN_SUPPORT
38 |
39 |
40 | #include "ULib.h"
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/export_include/UDataBase.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define ULIB_DB_TYPE_SQLITE 1
4 | #define ULIB_DB_TYPE_MYSQL 2
5 | #define ULIB_DB_TYPE_SQLSERVICE 3
6 | #define ULIB_DB_TYPE_MONGODB 4
7 |
8 | struct STDBDATA
9 | {
10 | CString csTitle;
11 | CString csData;
12 | };
13 |
14 | class CFormatData
15 | {
16 | public:
17 | CFormatData(){}
18 | ~CFormatData(){}
19 | vector m_vField;
20 | vector m_vData;
21 | CString m_csTable;
22 |
23 | public:
24 |
25 | protected:
26 |
27 | private:
28 | };
29 |
30 | class CDBCtrlBase
31 | {
32 | public:
33 | CDBCtrlBase(){}
34 | virtual ~CDBCtrlBase(){}
35 |
36 | public:
37 | virtual int Connect(CString csDB, CString csName = _T(""), CString csPwd =_T("")) = 0;
38 | virtual int Close() = 0;
39 | virtual void SelectData() = 0;
40 | virtual void CtrlData(CString csSql) = 0;
41 | virtual int ClearTable(CString csTable) = 0;
42 | virtual int DeleteTable(CString csTable) = 0;
43 | bool IsOpen()
44 | {
45 | return m_bOpen;
46 | }
47 |
48 | protected:
49 | CString m_csDB;
50 | bool m_bOpen;
51 | };
52 |
53 | class CDBbase
54 | {
55 | public:
56 | CDBbase(void);
57 | ~CDBbase(void);
58 |
59 | public:
60 | void SetDBType(int iMode);
61 | int ConnectDB(CString csDB, CString csName = _T(""), CString csPwd =_T(""));
62 | int CloseDB();
63 | int InsertData(CString csSql);
64 | int ClearTable(CString csDB);
65 | int SelectData(CFormatData &clsData);
66 |
67 | protected:
68 | boost::shared_ptr m_db;
69 |
70 | private:
71 | };
72 |
73 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.cpp:
--------------------------------------------------------------------------------
1 | // UiCommTools.cpp : Defines the initialization routines for the DLL.
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "UiCommTools.h"
6 |
7 | #ifdef _DEBUG
8 | #define new DEBUG_NEW
9 | #endif
10 |
11 | //
12 | //TODO: If this DLL is dynamically linked against the MFC DLLs,
13 | // any functions exported from this DLL which call into
14 | // MFC must have the AFX_MANAGE_STATE macro added at the
15 | // very beginning of the function.
16 | //
17 | // For example:
18 | //
19 | // extern "C" BOOL PASCAL EXPORT ExportedFunction()
20 | // {
21 | // AFX_MANAGE_STATE(AfxGetStaticModuleState());
22 | // // normal function body here
23 | // }
24 | //
25 | // It is very important that this macro appear in each
26 | // function, prior to any calls into MFC. This means that
27 | // it must appear as the first statement within the
28 | // function, even before any object variable declarations
29 | // as their constructors may generate calls into the MFC
30 | // DLL.
31 | //
32 | // Please see MFC Technical Notes 33 and 58 for additional
33 | // details.
34 | //
35 |
36 | // CUiCommToolsApp
37 |
38 | BEGIN_MESSAGE_MAP(CUiCommToolsApp, CWinApp)
39 | END_MESSAGE_MAP()
40 |
41 |
42 | // CUiCommToolsApp construction
43 |
44 | CUiCommToolsApp::CUiCommToolsApp()
45 | {
46 | // TODO: add construction code here,
47 | // Place all significant initialization in InitInstance
48 | }
49 |
50 |
51 | // The one and only CUiCommToolsApp object
52 |
53 | CUiCommToolsApp theApp;
54 |
55 |
56 | // CUiCommToolsApp initialization
57 |
58 | BOOL CUiCommToolsApp::InitInstance()
59 | {
60 | CWinApp::InitInstance();
61 |
62 | return TRUE;
63 | }
64 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/UInterfaceLib.cpp:
--------------------------------------------------------------------------------
1 | // UInterfaceLib.cpp : Defines the initialization routines for the DLL.
2 | //
3 |
4 | #include "stdafx.h"
5 | #include "UInterfaceLib.h"
6 |
7 | #ifdef _DEBUG
8 | #define new DEBUG_NEW
9 | #endif
10 |
11 | //
12 | //TODO: If this DLL is dynamically linked against the MFC DLLs,
13 | // any functions exported from this DLL which call into
14 | // MFC must have the AFX_MANAGE_STATE macro added at the
15 | // very beginning of the function.
16 | //
17 | // For example:
18 | //
19 | // extern "C" BOOL PASCAL EXPORT ExportedFunction()
20 | // {
21 | // AFX_MANAGE_STATE(AfxGetStaticModuleState());
22 | // // normal function body here
23 | // }
24 | //
25 | // It is very important that this macro appear in each
26 | // function, prior to any calls into MFC. This means that
27 | // it must appear as the first statement within the
28 | // function, even before any object variable declarations
29 | // as their constructors may generate calls into the MFC
30 | // DLL.
31 | //
32 | // Please see MFC Technical Notes 33 and 58 for additional
33 | // details.
34 | //
35 |
36 | // CUInterfaceLibApp
37 |
38 | BEGIN_MESSAGE_MAP(CUInterfaceLibApp, CWinApp)
39 | END_MESSAGE_MAP()
40 |
41 |
42 | // CUInterfaceLibApp construction
43 |
44 | CUInterfaceLibApp::CUInterfaceLibApp()
45 | {
46 | // TODO: add construction code here,
47 | // Place all significant initialization in InitInstance
48 | }
49 |
50 |
51 | // The one and only CUInterfaceLibApp object
52 |
53 | CUInterfaceLibApp theApp;
54 |
55 |
56 | // CUInterfaceLibApp initialization
57 |
58 | BOOL CUInterfaceLibApp::InitInstance()
59 | {
60 | CWinApp::InitInstance();
61 |
62 | return TRUE;
63 | }
64 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCFileIni.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CCFileIni.h"
3 |
4 |
5 | CCFileIni::CCFileIni(void)
6 | {
7 | }
8 |
9 |
10 | CCFileIni::~CCFileIni(void)
11 | {
12 | }
13 |
14 | int CCFileIni::InitFile(string strPath)
15 | {
16 | int iRet = 0;
17 |
18 | string strError = "";
19 | if ( CCommTools::GetInstance()->file_exist(strPath, strError) == ULIB_RETURN_FALSE )
20 | {
21 | std::ofstream file(strPath);
22 | }
23 |
24 | m_strPath = strPath;
25 |
26 | return iRet;
27 | }
28 |
29 | string CCFileIni::Get(string strTitle, string strA)
30 | {
31 | string strC = "";
32 |
33 | CString csRet;
34 | ::GetPrivateProfileString(CCommTools::GetInstance()->string_A2W(strTitle.c_str(), strTitle.length()),
35 | CCommTools::GetInstance()->string_A2W(strA.c_str(), strA.length()),
36 | _T("Default"),
37 | csRet.GetBuffer(MAX_PATH),
38 | MAX_PATH,
39 | CCommTools::GetInstance()->string_A2W(m_strPath.c_str(), m_strPath.length()));
40 | strC = CCommTools::GetInstance()->string_W2A(csRet);
41 |
42 | return strC;
43 | }
44 |
45 | void CCFileIni::Add(string strA, string strB, string strC)
46 | {
47 | ::WritePrivateProfileString(CCommTools::GetInstance()->string_A2W(strA.c_str(), strA.length()),
48 | CCommTools::GetInstance()->string_A2W(strB.c_str(), strB.length()),
49 | CCommTools::GetInstance()->string_A2W(strC.c_str(), strC.length()),
50 | CCommTools::GetInstance()->string_A2W(m_strPath.c_str(), m_strPath.length()));
51 | }
52 |
53 | void CCFileIni::Add( vector v_stPair )
54 | {
55 |
56 | }
57 |
58 | void CCFileIni::WriteFile(string strPath)
59 | {
60 |
61 | }
62 |
63 | void CCFileIni::ClearnFile()
64 | {
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CDBbase.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | struct STDBDATA
4 | {
5 | CString csTitle;
6 | CString csData;
7 | };
8 |
9 | class CFormatData
10 | {
11 | public:
12 | CFormatData(){}
13 | ~CFormatData(){}
14 | vector m_vField;
15 | vector m_vData;
16 | CString m_csTable;
17 |
18 | public:
19 |
20 | protected:
21 |
22 | private:
23 | };
24 |
25 | class __declspec(dllexport) CDBCtrlBase
26 | {
27 | public:
28 | CDBCtrlBase(){}
29 | virtual ~CDBCtrlBase(){}
30 |
31 | public:
32 | virtual int Connect(CString csHost, CString csDB, CString csName, CString csPwd) = 0;
33 | virtual int Connect(CString csDB, CString csName, CString csPwd) = 0;
34 | virtual int Close() = 0;
35 | virtual int SelectData(CFormatData &clsData, CString csDB = _T("")) = 0;
36 | virtual int CtrlData(CString csSql, CString csDB = _T("")) = 0;
37 | virtual int ClearTable(CString csTable, CString csDB = _T("")) = 0;
38 | virtual int DeleteTable(CString csTable, CString csDB = _T("")) = 0;
39 | virtual bool IsOpen()
40 | {
41 | return m_bOpen;
42 | }
43 |
44 | protected:
45 | CString m_csDB;
46 | bool m_bOpen;
47 | };
48 |
49 | class __declspec(dllexport) CDBbase
50 | {
51 | public:
52 | CDBbase(void);
53 | ~CDBbase(void);
54 |
55 | public:
56 | void SetDBType(int iMode);
57 | int ConnectDB(CString csDB, CString csName = _T(""), CString csPwd =_T(""));
58 | int Connect(CString csHost, CString csDB, CString csName, CString csPwd);
59 | int CloseDB();
60 | int InsertData(CString sql);
61 | int ClearTable(CString csDB);
62 | int SelectData(CFormatData &clsData);
63 | int GetDBType();
64 |
65 | protected:
66 | boost::shared_ptr m_db;
67 | int m_iDBType;
68 |
69 | private:
70 | };
71 |
72 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/SerialTools/CCmdStation.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 |
3 | CCmdStation::CCmdStation(void)
4 | {
5 | this->m_pRecvBuf = new UCHAR[COM_BUF_LEN];
6 | this->m_nRcvIndex = 0;
7 |
8 | this->m_nFrameLength = 0;
9 | this->m_bFrameStart = FALSE;
10 | }
11 |
12 | CCmdStation::~CCmdStation(void)
13 | {
14 | if (this->m_pRecvBuf != NULL)
15 | {
16 | delete[] this->m_pRecvBuf;
17 | this->m_pRecvBuf = NULL;
18 | }
19 | }
20 |
21 | void CCmdStation::RecvData(unsigned char nData)
22 | {
23 | if (nData== 0xFE && !m_bFrameStart)
24 | {
25 | m_pRecvBuf[0] = 0xFE;
26 | m_nRcvIndex = 1;
27 | m_bFrameStart = true;
28 | return;
29 | }
30 |
31 | if (m_bFrameStart)
32 | {
33 | //put received data into buffer
34 | m_pRecvBuf[m_nRcvIndex] = nData;
35 | if ( m_nRcvIndex == 1 )
36 | {
37 | this->m_nFrameLength = nData + 5;
38 | }
39 | m_nRcvIndex++;
40 |
41 | ////receive one frame, invoke ParseFrame to parse
42 | if ( this->m_nRcvIndex == this->m_nFrameLength )
43 | {
44 | //if ( this->m_pRecvBuf[this->m_nFrameLength - 1] != this->m_Tools.BCC(&this->m_pRecvBuf[1], m_nFrameLength - 2) )
45 | //{
46 | // this->ResetRcvBuf();
47 | // return;
48 | //}
49 |
50 | SetRecvBuf();
51 |
52 | this->ResetRcvBuf();
53 | }
54 |
55 | if ( m_nRcvIndex > 100 )
56 | {
57 | this->ResetRcvBuf();
58 | return;
59 | }
60 | }
61 | }
62 |
63 | void CCmdStation::ResetRcvBuf()
64 | {
65 | memset(m_pRecvBuf, 0x00, COM_BUF_LEN);
66 | m_nRcvIndex = 0;
67 | this->m_nFrameLength = 0;
68 | m_bFrameStart = false;
69 | }
70 |
71 | void CCmdStation::SetRecvBuf()
72 | {
73 | this->ResetRcvBuf();
74 | }
75 |
76 | void CCmdStation::SetRecvLine()
77 | {
78 | this->ResetRcvBuf();
79 | }
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/version_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 | /* Please do not edit this file - it is generated by cmake. Edit its source file instead. */
26 |
27 | #define MYCPPCONN_DM_MAJOR_VERSION 1
28 | #define MYCPPCONN_DM_MINOR_VERSION 1
29 | #define MYCPPCONN_DM_PATCH_VERSION 6
30 |
31 | #define MYCPPCONN_DM_VERSION "1.01.0006"
32 | #define MYCPPCONN_DM_VERSION_ID 1010006
33 |
34 |
35 | /* Driver version info */
36 |
37 | #define MYCPPCONN_STATIC_MYSQL_VERSION ""
38 | #define MYCPPCONN_STATIC_MYSQL_VERSION_ID
39 |
40 | #define MYCPPCONN_BOOST_VERSION 105400
41 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/mysql_error.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _MYSQL_ERROR_H_
28 | #define _MYSQL_ERROR_H_
29 |
30 | namespace sql
31 | {
32 | namespace mysql
33 | {
34 | /* Driver specific errors */
35 | enum DRIVER_ERROR {
36 | /* Underlying client library(cl) can't deal with expired password.
37 | Raised when password actually expires */
38 | deCL_CANT_HANDLE_EXP_PWD= 820
39 | };
40 | } /* namespace mysql */
41 | } /* namespace sql */
42 |
43 | #endif /* _MYSQL_ERROR_H_ */
44 |
45 | /*
46 | * Local variables:
47 | * tab-width: 4
48 | * c-basic-offset: 4
49 | * End:
50 | * vim600: noet sw=4 ts=4 fdm=marker
51 | * vim<600: noet sw=4 ts=4
52 | */
53 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/datatype.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_DATATYPE_H_
28 | #define _SQL_DATATYPE_H_
29 |
30 | namespace sql
31 | {
32 |
33 | class DataType
34 | {
35 | DataType();
36 | public:
37 | enum {
38 | UNKNOWN = 0,
39 | BIT,
40 | TINYINT,
41 | SMALLINT,
42 | MEDIUMINT,
43 | INTEGER,
44 | BIGINT,
45 | REAL,
46 | DOUBLE,
47 | DECIMAL,
48 | NUMERIC,
49 | CHAR,
50 | BINARY,
51 | VARCHAR,
52 | VARBINARY,
53 | LONGVARCHAR,
54 | LONGVARBINARY,
55 | TIMESTAMP,
56 | DATE,
57 | TIME,
58 | YEAR,
59 | GEOMETRY,
60 | ENUM,
61 | SET,
62 | SQLNULL
63 | };
64 | };
65 |
66 | } /* namespace */
67 |
68 | #endif /* _SQL_DATATYPE_H_ */
69 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CCamDealData.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CCamDealData.h"
3 |
4 |
5 | CCamDealData::CCamDealData(void)
6 | {
7 | m_pBuf = new BYTE[VIDEO_WIDTH*VIDEO_HEIGHT*3];
8 | memset(m_pBuf, 0x00, sizeof(m_pBuf));
9 | }
10 |
11 | CCamDealData::~CCamDealData(void)
12 | {
13 | }
14 |
15 | void CCamDealData::DealCamData(BYTE * pBuffer, long lWidth,long lHeight)
16 | {
17 | this->ProcessBuf(pBuffer, lWidth, lHeight);
18 | }
19 |
20 | void CCamDealData::ProcessBuf(BYTE * pBuffer, long lWidth,long lHeight)
21 | {
22 | if ((lWidth!=VIDEO_WIDTH)||(lHeight!=VIDEO_HEIGHT))
23 | {
24 | return;
25 | }
26 |
27 | int count = 0;
28 | for (int j = lHeight-1; j >=0; j--)
29 | {
30 | for (int i = 0; i < lWidth; i++)
31 | {
32 | memcpy(m_pBuf+count*3,pBuffer+(j*lWidth+i)*3,3);
33 | count++;
34 | }
35 | }
36 | }
37 |
38 | cv::Mat CCamDealData::SceenShot()
39 | {
40 | BYTE *pBuf = new BYTE[VIDEO_WIDTH * VIDEO_HEIGHT * 3];
41 | memset(pBuf, 0x00, sizeof(pBuf));
42 |
43 | memcpy(pBuf,m_pBuf,VIDEO_WIDTH*VIDEO_HEIGHT*3);
44 |
45 | Mat mImage(VIDEO_HEIGHT, VIDEO_WIDTH, CV_8UC3, pBuf);
46 |
47 | return mImage;
48 | }
49 |
50 | void CCamDealData::GrabVideoFrames(BOOL bGrabVideoFrames)
51 | {
52 | if ( bGrabVideoFrames )
53 | {
54 | m_Cam.GrabVideoFrames(bGrabVideoFrames, this);
55 | }
56 | else
57 | {
58 | m_Cam.GrabVideoFrames(bGrabVideoFrames, nullptr);
59 | }
60 | }
61 |
62 | HRESULT CCamDealData::Open(int iDeviceID,HWND hWnd)
63 | {
64 | if ( hWnd == nullptr )
65 | {
66 | return S_FALSE;
67 | }
68 |
69 | return m_Cam.Open(iDeviceID, hWnd);
70 | }
71 |
72 | HRESULT CCamDealData::Close()
73 | {
74 | return m_Cam.Close();
75 | }
76 |
77 | int CCamDealData::EnumDevices(HWND hList)
78 | {
79 | if ( hList == nullptr )
80 | {
81 | return -1;
82 | }
83 |
84 | return m_Cam.EnumDevices(hList);
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/build_config.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_BUILD_CONFIG_H_
28 | #define _SQL_BUILD_CONFIG_H_
29 |
30 | #ifndef CPPCONN_PUBLIC_FUNC
31 |
32 | #if defined(_WIN32)
33 | // mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only
34 | #ifdef mysqlcppconn_EXPORTS
35 | #define CPPCONN_PUBLIC_FUNC __declspec(dllexport)
36 | #else
37 | // this is for static build
38 | #ifdef CPPCONN_LIB_BUILD
39 | #define CPPCONN_PUBLIC_FUNC
40 | #else
41 | // this is for clients using dynamic lib
42 | #define CPPCONN_PUBLIC_FUNC __declspec(dllimport)
43 | #endif
44 | #endif
45 | #else
46 | #define CPPCONN_PUBLIC_FUNC
47 | #endif
48 |
49 | #endif //#ifndef CPPCONN_PUBLIC_FUNC
50 |
51 | #endif //#ifndef _SQL_BUILD_CONFIG_H_
52 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CDBbase.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CDBbase.h"
3 |
4 |
5 | CDBbase::CDBbase(void)
6 | {
7 | }
8 |
9 |
10 | CDBbase::~CDBbase(void)
11 | {
12 | }
13 |
14 |
15 | void CDBbase::SetDBType(int iType)
16 | {
17 | if ( iType == 1 )
18 | {
19 | m_db = boost::shared_ptr(new CSqliteCtrl());
20 | }
21 | else if ( iType == 2 )
22 | {
23 |
24 | }
25 | }
26 |
27 | int CDBbase::InsertData(CString csSql)
28 | {
29 | int iRet = -1;
30 | if ( !m_db )
31 | {
32 | return iRet;
33 | }
34 |
35 | iRet = m_db->CtrlData(csSql);
36 |
37 | return iRet;
38 | }
39 |
40 | int CDBbase::ConnectDB(CString csDB, CString csName, CString csPwd)
41 | {
42 | int iRet = -1;
43 | if ( !m_db )
44 | {
45 | return iRet;
46 | }
47 |
48 | iRet = m_db->Connect(csDB, csName, csPwd);
49 |
50 | return iRet;
51 | }
52 |
53 | int CDBbase::CloseDB()
54 | {
55 | int iRet = -1;
56 |
57 | if ( !m_db )
58 | {
59 | return iRet;
60 | }
61 |
62 | iRet = m_db->Close();
63 |
64 | return iRet;
65 | }
66 |
67 | int CDBbase::ClearTable(CString csTable)
68 | {
69 | int iRet = -1;
70 |
71 | if ( !m_db )
72 | {
73 | return iRet;
74 | }
75 |
76 | iRet = m_db->ClearTable(csTable);
77 |
78 | return iRet;
79 | }
80 |
81 | int CDBbase::SelectData(CFormatData &clsData)
82 | {
83 | int iRet = -1;
84 |
85 | if ( !m_db )
86 | {
87 | return iRet;
88 | }
89 |
90 | if ( clsData.m_vField.size() > 0 && !clsData.m_csTable.IsEmpty() )
91 | {
92 | iRet = m_db->SelectData(clsData);
93 | }
94 |
95 | return iRet;
96 | }
97 |
98 | int CDBbase::Connect( CString csHost, CString csDB, CString csName, CString csPwd )
99 | {
100 | int iRet = -1;
101 |
102 | if ( m_iDBType == 1 )
103 | {
104 | if ( !m_db )
105 | {
106 | return iRet;
107 | }
108 |
109 | iRet = m_db->Connect(csHost, csName, csPwd);
110 | }
111 |
112 | return iRet;
113 | }
114 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CvvImage.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #ifndef CVVIMAGE_CLASS_DEF
3 | #define CVVIMAGE_CLASS_DEF
4 | #include "opencv.hpp"
5 | class CvvImage
6 | {
7 | public:
8 | CvvImage();
9 | virtual ~CvvImage();
10 | /* Create image (BGR or grayscale) */
11 | virtual bool Create( int width, int height, int bits_per_pixel, int image_origin = 0 );
12 | /* Load image from specified file */
13 | virtual bool Load( const char* filename, int desired_color = 1 );
14 | /* Load rectangle from the file */
15 | virtual bool LoadRect( const char* filename,
16 | int desired_color, CvRect r );
17 | #if defined WIN32 || defined _WIN32
18 | virtual bool LoadRect( const char* filename,
19 | int desired_color, RECT r )
20 | {
21 | return LoadRect( filename, desired_color,
22 | cvRect( r.left, r.top, r.right - r.left, r.bottom - r.top ));
23 | }
24 | #endif
25 | /* Save entire image to specified file. */
26 | virtual bool Save( const char* filename );
27 | /* Get copy of input image ROI */
28 | virtual void CopyOf( CvvImage& image, int desired_color = -1 );
29 | virtual void CopyOf( IplImage* img, int desired_color = -1 );
30 | IplImage* GetImage() { return m_img; };
31 | virtual void Destroy(void);
32 | /* width and height of ROI */
33 | int Width() { return !m_img ? 0 : !m_img->roi ? m_img->width : m_img->roi->width; };
34 | int Height() { return !m_img ? 0 : !m_img->roi ? m_img->height : m_img->roi->height;};
35 | int Bpp() { return m_img ? (m_img->depth & 255)*m_img->nChannels : 0; };
36 | virtual void Fill( int color );
37 | /* draw to highgui window */
38 | virtual void Show( const char* window );
39 |
40 | #if defined WIN32 || defined _WIN32
41 | /* draw part of image to the specified DC */
42 | virtual void Show( HDC dc, int x, int y, int width, int height,
43 | int from_x = 0, int from_y = 0 );
44 | /* draw the current image ROI to the specified rectangle of the destination DC */
45 | virtual void DrawToHDC( HDC hDCDst, RECT* pDstRect );
46 | #endif
47 | protected:
48 | IplImage* m_img;
49 | };
50 | typedef CvvImage CMyImage;
51 | #endif
52 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CConfigBase.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CConfigBase.h"
3 |
4 |
5 | CConfigBase::CConfigBase(void)
6 | {
7 | }
8 |
9 |
10 | CConfigBase::~CConfigBase(void)
11 | {
12 | }
13 |
14 | int CConfigBase::LoadConfig(string strPath, vector &v_stPair)
15 | {
16 | int iRet = ULIB_FALSE;
17 |
18 |
19 |
20 | m_strPath = strPath;
21 |
22 | iRet = m_pFile->InitFile(strPath);
23 | for ( int i = 0; i < v_stPair.size(); i++ )
24 | {
25 | string strData = m_pFile->Get(v_stPair[i].strTitle, v_stPair[i].strA);
26 | v_stPair[i].strB = strData;
27 | }
28 |
29 | return iRet;
30 | }
31 |
32 | int CConfigBase::SaveConfig(string strPath, vector v_stPair)
33 | {
34 | int iRet = ULIB_FALSE;
35 |
36 | m_pFile->InitFile(strPath);
37 | m_pFile->ClearnFile();
38 |
39 | m_pFile->Add(v_stPair);
40 |
41 | m_pFile->WriteFile(strPath);
42 |
43 | return iRet;
44 | }
45 |
46 | boolean CConfigBase::SetFileType(int iType)
47 | {
48 | boolean bRet = true;
49 | m_iType = iType;
50 |
51 | if ( iType == ULIB_FILE_TYPE_XML )
52 | {
53 | m_pFile = boost::shared_ptr(new CCFileXml());
54 | }
55 | else if ( iType == ULIB_FILE_TYPE_INI )
56 | {
57 | m_pFile = boost::shared_ptr(new CCFileIni());
58 | }
59 | else
60 | {
61 | bRet = false;
62 | }
63 |
64 | return bRet;
65 | }
66 |
67 | boost::shared_ptr m_pConfig = nullptr;
68 |
69 | extern "C" __declspec(dllexport) int LoadConfig(int iType, string strPath, vector &v_stPair)
70 | {
71 | if ( m_pConfig == nullptr )
72 | {
73 | m_pConfig = boost::shared_ptr(new CConfigBase());
74 | }
75 |
76 | m_pConfig->SetFileType(iType);
77 | int iRet = m_pConfig->LoadConfig(strPath, v_stPair);
78 |
79 | return iRet;
80 | }
81 |
82 | extern "C" __declspec(dllexport) int SaveConfig(int iType, string strPath, vector &v_stPair)
83 | {
84 | if ( m_pConfig == nullptr )
85 | {
86 | m_pConfig = boost::shared_ptr(new CConfigBase());
87 | }
88 |
89 | m_pConfig->SetFileType(iType);
90 | int iRet = m_pConfig->SaveConfig(strPath, v_stPair);
91 |
92 | return iRet;
93 | }
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/warning.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_WARNING_H_
28 | #define _SQL_WARNING_H_
29 |
30 |
31 | #include
32 | #include
33 | #include
34 | #include "sqlstring.h"
35 |
36 | namespace sql
37 | {
38 |
39 | #ifdef _WIN32
40 | #pragma warning (disable : 4290)
41 | //warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
42 | #endif
43 |
44 | class SQLWarning
45 | {
46 | public:
47 |
48 | SQLWarning(){}
49 |
50 | virtual const sql::SQLString & getMessage() const = 0;
51 |
52 | virtual const sql::SQLString & getSQLState() const = 0;
53 |
54 | virtual int getErrorCode() const = 0;
55 |
56 | virtual const SQLWarning * getNextWarning() const = 0;
57 |
58 | virtual void setNextWarning(const SQLWarning * _next) = 0;
59 |
60 | protected:
61 |
62 | virtual ~SQLWarning(){};
63 |
64 | SQLWarning(const SQLWarning& e){};
65 |
66 | private:
67 | const SQLWarning & operator = (const SQLWarning & rhs);
68 |
69 | };
70 |
71 |
72 | } /* namespace sql */
73 |
74 | #endif /* _SQL_WARNING_H_ */
75 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/parameter_metadata.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_PARAMETER_METADATA_H_
28 | #define _SQL_PARAMETER_METADATA_H_
29 |
30 | #include
31 |
32 |
33 | namespace sql
34 | {
35 |
36 | class ParameterMetaData
37 | {
38 | public:
39 | enum
40 | {
41 | parameterModeIn,
42 | parameterModeInOut,
43 | parameterModeOut,
44 | parameterModeUnknown
45 | };
46 | enum
47 | {
48 | parameterNoNulls,
49 | parameterNullable,
50 | parameterNullableUnknown
51 | };
52 |
53 | virtual sql::SQLString getParameterClassName(unsigned int param) = 0;
54 |
55 | virtual int getParameterCount() = 0;
56 |
57 | virtual int getParameterMode(unsigned int param) = 0;
58 |
59 | virtual int getParameterType(unsigned int param) = 0;
60 |
61 | virtual sql::SQLString getParameterTypeName(unsigned int param) = 0;
62 |
63 | virtual int getPrecision(unsigned int param) = 0;
64 |
65 | virtual int getScale(unsigned int param) = 0;
66 |
67 | virtual int isNullable(unsigned int param) = 0;
68 |
69 | virtual bool isSigned(unsigned int param) = 0;
70 |
71 | protected:
72 | virtual ~ParameterMetaData() {}
73 | };
74 |
75 |
76 | } /* namespace sql */
77 |
78 | #endif /* _SQL_PARAMETER_METADATA_H_ */
79 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/driver.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_DRIVER_H_
28 | #define _SQL_DRIVER_H_
29 |
30 | #include "connection.h"
31 | #include "build_config.h"
32 |
33 | namespace sql
34 | {
35 |
36 | class CPPCONN_PUBLIC_FUNC Driver
37 | {
38 | protected:
39 | virtual ~Driver() {}
40 | public:
41 | // Attempts to make a database connection to the given URL.
42 |
43 | virtual Connection * connect(const sql::SQLString& hostName, const sql::SQLString& userName, const sql::SQLString& password) = 0;
44 |
45 | virtual Connection * connect(ConnectOptionsMap & options) = 0;
46 |
47 | virtual int getMajorVersion() = 0;
48 |
49 | virtual int getMinorVersion() = 0;
50 |
51 | virtual int getPatchVersion() = 0;
52 |
53 | virtual const sql::SQLString & getName() = 0;
54 |
55 | virtual void threadInit() = 0;
56 |
57 | virtual void threadEnd() = 0;
58 | };
59 |
60 | } /* namespace sql */
61 |
62 | extern "C"
63 | {
64 | CPPCONN_PUBLIC_FUNC sql::Driver * get_driver_instance();
65 |
66 | /* If dynamic loading is disabled in a driver then this function works just like get_driver_instance() */
67 | CPPCONN_PUBLIC_FUNC sql::Driver * get_driver_instance_by_name(const char * const clientlib);
68 | }
69 |
70 | #endif /* _SQL_DRIVER_H_ */
71 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/UiCommTools.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 |
20 | Source Files
21 |
22 |
23 | Resource Files
24 |
25 |
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 | Source Files
41 |
42 |
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 | Header Files
67 |
68 |
69 |
70 |
71 | Resource Files
72 |
73 |
74 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/statement.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_STATEMENT_H_
28 | #define _SQL_STATEMENT_H_
29 |
30 | #include "config.h"
31 | #include "resultset.h"
32 |
33 | #include
34 |
35 | namespace sql
36 | {
37 |
38 | class ResultSet;
39 | class Connection;
40 | class SQLWarning;
41 |
42 |
43 | class Statement
44 | {
45 | public:
46 | virtual ~Statement() {};
47 |
48 | virtual Connection * getConnection() = 0;
49 |
50 | virtual void cancel() = 0;
51 |
52 | virtual void clearWarnings() = 0;
53 |
54 | virtual void close() = 0;
55 |
56 | virtual bool execute(const sql::SQLString& sql) = 0;
57 |
58 | virtual ResultSet * executeQuery(const sql::SQLString& sql) = 0;
59 |
60 | virtual int executeUpdate(const sql::SQLString& sql) = 0;
61 |
62 | virtual size_t getFetchSize() = 0;
63 |
64 | virtual unsigned int getMaxFieldSize() = 0;
65 |
66 | virtual uint64_t getMaxRows() = 0;
67 |
68 | virtual bool getMoreResults() = 0;
69 |
70 | virtual unsigned int getQueryTimeout() = 0;
71 |
72 | virtual ResultSet * getResultSet() = 0;
73 |
74 | virtual sql::ResultSet::enum_type getResultSetType() = 0;
75 |
76 | virtual uint64_t getUpdateCount() = 0;
77 |
78 | virtual const SQLWarning * getWarnings() = 0;
79 |
80 | virtual void setCursorName(const sql::SQLString & name) = 0;
81 |
82 | virtual void setEscapeProcessing(bool enable) = 0;
83 |
84 | virtual void setFetchSize(size_t rows) = 0;
85 |
86 | virtual void setMaxFieldSize(unsigned int max) = 0;
87 |
88 | virtual void setMaxRows(unsigned int max) = 0;
89 |
90 | virtual void setQueryTimeout(unsigned int seconds) = 0;
91 |
92 | virtual Statement * setResultSetType(sql::ResultSet::enum_type type) = 0;
93 | };
94 |
95 | } /* namespace sql */
96 |
97 | #endif /* _SQL_STATEMENT_H_ */
98 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | MICROSOFT FOUNDATION CLASS LIBRARY : UiCommTools Project Overview
3 | ========================================================================
4 |
5 |
6 | AppWizard has created this UiCommTools DLL for you. This DLL not only
7 | demonstrates the basics of using the Microsoft Foundation classes but
8 | is also a starting point for writing your DLL.
9 |
10 | This file contains a summary of what you will find in each of the files that
11 | make up your UiCommTools DLL.
12 |
13 | UiCommTools.vcxproj
14 | This is the main project file for VC++ projects generated using an Application Wizard.
15 | It contains information about the version of Visual C++ that generated the file, and
16 | information about the platforms, configurations, and project features selected with the
17 | Application Wizard.
18 |
19 | UiCommTools.vcxproj.filters
20 | This is the filters file for VC++ projects generated using an Application Wizard.
21 | It contains information about the association between the files in your project
22 | and the filters. This association is used in the IDE to show grouping of files with
23 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the
24 | "Source Files" filter).
25 |
26 | UiCommTools.h
27 | This is the main header file for the DLL. It declares the
28 | CUiCommToolsApp class.
29 |
30 | UiCommTools.cpp
31 | This is the main DLL source file. It contains the class CUiCommToolsApp.
32 |
33 | UiCommTools.rc
34 | This is a listing of all of the Microsoft Windows resources that the
35 | program uses. It includes the icons, bitmaps, and cursors that are stored
36 | in the RES subdirectory. This file can be directly edited in Microsoft
37 | Visual C++.
38 |
39 | res\UiCommTools.rc2
40 | This file contains resources that are not edited by Microsoft
41 | Visual C++. You should place all resources not editable by
42 | the resource editor in this file.
43 |
44 | UiCommTools.def
45 | This file contains information about the DLL that must be
46 | provided to run with Microsoft Windows. It defines parameters
47 | such as the name and description of the DLL. It also exports
48 | functions from the DLL.
49 |
50 | /////////////////////////////////////////////////////////////////////////////
51 | Other standard files:
52 |
53 | StdAfx.h, StdAfx.cpp
54 | These files are used to build a precompiled header (PCH) file
55 | named UiCommTools.pch and a precompiled types file named StdAfx.obj.
56 |
57 | Resource.h
58 | This is the standard header file, which defines new resource IDs.
59 | Microsoft Visual C++ reads and updates this file.
60 |
61 | /////////////////////////////////////////////////////////////////////////////
62 | Other notes:
63 |
64 | AppWizard uses "TODO:" to indicate parts of the source code you
65 | should add to or customize.
66 |
67 | /////////////////////////////////////////////////////////////////////////////
68 |
--------------------------------------------------------------------------------
/UiCommTools/UiCommTools/CommTools.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifndef SAFE_RELEASE
4 | #define SAFE_RELEASE( x ) \
5 | if ( NULL != x ) \
6 | { \
7 | x->Release( ); \
8 | x = NULL; \
9 | }
10 | #endif
11 |
12 | class __declspec(dllexport) CCommTools
13 | {
14 | public:
15 | static CCommTools *GetInstance()
16 | {
17 | if ( m_Instance == nullptr )
18 | {
19 | m_Instance = new CCommTools();
20 | }
21 |
22 | return m_Instance;
23 | }
24 |
25 | static void RealeaseInstance()
26 | {
27 | delete m_Instance;
28 | m_Instance = nullptr;
29 | }
30 |
31 | public:
32 | /** checkctrl */
33 | unsigned char check_bcc(unsigned char *pData, int iLen, int iOffset = 0);
34 | unsigned char check_sum(unsigned char *pData, int iLen, int iOffset = 0);
35 |
36 | /** timectrl */
37 | string date_getloctime(int iMode = 0);
38 | string date_getlocdate(int iMode = 0);
39 |
40 | /** stringctrl */
41 | char* string_W2A(CString csData);
42 | WCHAR*string_A2W(char *pstr, int ilen);
43 | WCHAR*string_A2W(const char *pstr, int iStrlen);
44 | char* string_W2UTF8(CString csBuffer);
45 | char* string_Encode2UTF8(const char* mbcsStr);
46 | CString string_ucharformat(unsigned char *pBuf, int iMode, int iLen);
47 | unsigned char *string_W2Byte(CString csframe);
48 | template
49 | void to_string(string & result,const T& t);
50 | template
51 | out_type string_convert(const in_value & t);
52 |
53 | /** imagedealctrl */
54 | void imagedeal_closewindow(char *title);
55 | bool imagedeal_ispic(CString csType);
56 | void imagedeal_openpicdlg(CStringArray &csPath, int iCount = 0);
57 | int imagedeal_angle(CPoint center, CPoint startPoint, CPoint desPooint);
58 | int imagedeal_direction(CPoint startPoint, CPoint endPoint, CPoint cenPoint);
59 |
60 | /** windowsctrl */
61 | ULIB_RETURN windows_getmac(vector &v_mac);
62 | ULIB_RETURN windows_openURL(CString csUrl);
63 | void windows_filedlg(CString csFileFilter, CStringArray &csPath);
64 | void windows_transparentwnd(HWND hWnd,COLORREF clr,BYTE byAlpha,DWORD dwFlags);
65 | void windows_show2List(CListBox *pList, CString csMessage);
66 | void windows_setfont(CFont *pfont, long lHeight, CString csFaceName);
67 | void windows_setfont(CFont *pfont, long lHeight, long lWeight, CString csFaceName);
68 |
69 | /** pathctrl */
70 | ULIB_RETURN path_filename(string strPath, string &strfilename);
71 | ULIB_RETURN path_extension(string strPath, string &strextension);
72 | ULIB_RETURN path_stem(string strPath, string &strstem);
73 | ULIB_RETURN path_withoutfilename(string strPath, string &strDesPath);
74 |
75 | /** filectrl */
76 | ULIB_RETURN file_exist(string strPath, string &strError);
77 | ULIB_RETURN file_currentpath(string &strcurrentpath, string &strError);
78 | ULIB_RETURN file_remove(string strPath, string &strError);
79 | ULIB_RETURN file_creat(string strPath, string &strError);
80 | ULIB_RETURN file_initialpath(string &strcurrentpath, string &strError);
81 |
82 | protected:
83 |
84 | private:
85 | CCommTools(void){}
86 | ~CCommTools(void){}
87 | static CCommTools* m_Instance;
88 | };
89 |
90 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | MICROSOFT FOUNDATION CLASS LIBRARY : UInterfaceLib Project Overview
3 | ========================================================================
4 |
5 |
6 | AppWizard has created this UInterfaceLib DLL for you. This DLL not only
7 | demonstrates the basics of using the Microsoft Foundation classes but
8 | is also a starting point for writing your DLL.
9 |
10 | This file contains a summary of what you will find in each of the files that
11 | make up your UInterfaceLib DLL.
12 |
13 | UInterfaceLib.vcxproj
14 | This is the main project file for VC++ projects generated using an Application Wizard.
15 | It contains information about the version of Visual C++ that generated the file, and
16 | information about the platforms, configurations, and project features selected with the
17 | Application Wizard.
18 |
19 | UInterfaceLib.vcxproj.filters
20 | This is the filters file for VC++ projects generated using an Application Wizard.
21 | It contains information about the association between the files in your project
22 | and the filters. This association is used in the IDE to show grouping of files with
23 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the
24 | "Source Files" filter).
25 |
26 | UInterfaceLib.h
27 | This is the main header file for the DLL. It declares the
28 | CUInterfaceLibApp class.
29 |
30 | UInterfaceLib.cpp
31 | This is the main DLL source file. It contains the class CUInterfaceLibApp.
32 |
33 | UInterfaceLib.rc
34 | This is a listing of all of the Microsoft Windows resources that the
35 | program uses. It includes the icons, bitmaps, and cursors that are stored
36 | in the RES subdirectory. This file can be directly edited in Microsoft
37 | Visual C++.
38 |
39 | res\UInterfaceLib.rc2
40 | This file contains resources that are not edited by Microsoft
41 | Visual C++. You should place all resources not editable by
42 | the resource editor in this file.
43 |
44 | UInterfaceLib.def
45 | This file contains information about the DLL that must be
46 | provided to run with Microsoft Windows. It defines parameters
47 | such as the name and description of the DLL. It also exports
48 | functions from the DLL.
49 |
50 | /////////////////////////////////////////////////////////////////////////////
51 | Other standard files:
52 |
53 | StdAfx.h, StdAfx.cpp
54 | These files are used to build a precompiled header (PCH) file
55 | named UInterfaceLib.pch and a precompiled types file named StdAfx.obj.
56 |
57 | Resource.h
58 | This is the standard header file, which defines new resource IDs.
59 | Microsoft Visual C++ reads and updates this file.
60 |
61 | /////////////////////////////////////////////////////////////////////////////
62 | Other notes:
63 |
64 | AppWizard uses "TODO:" to indicate parts of the source code you
65 | should add to or customize.
66 |
67 | /////////////////////////////////////////////////////////////////////////////
68 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CommTools.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifndef SAFE_RELEASE
4 | #define SAFE_RELEASE( x ) \
5 | if ( NULL != x ) \
6 | { \
7 | x->Release( ); \
8 | x = NULL; \
9 | }
10 | #endif
11 |
12 | class __declspec(dllexport) CCommTools
13 | {
14 | public:
15 | static CCommTools *GetInstance()
16 | {
17 | if ( m_Instance == nullptr )
18 | {
19 | m_Instance = new CCommTools();
20 | }
21 |
22 | return m_Instance;
23 | }
24 |
25 | static void RealeaseInstance()
26 | {
27 | delete m_Instance;
28 | m_Instance = nullptr;
29 | }
30 |
31 | public:
32 | /** checkctrl */
33 | unsigned char check_bcc(unsigned char *pData, int iLen, int iOffset = 0);
34 | unsigned char check_sum(unsigned char *pData, int iLen, int iOffset = 0);
35 |
36 | /** timectrl */
37 | string date_getloctime(int iMode = 0);
38 | string date_getlocdate(int iMode = 0);
39 |
40 | /** stringctrl */
41 | char* string_W2A(CString csData);
42 | WCHAR*string_A2W(char *pstr, int ilen);
43 | WCHAR*string_A2W(const char *pstr, int iStrlen);
44 | char* string_W2UTF8(CString csBuffer);
45 | char* string_Encode2UTF8(const char* mbcsStr);
46 | CString string_ucharformat(unsigned char *pBuf, int iMode, int iLen);
47 | unsigned char *string_W2Byte(CString csframe);
48 | template
49 | void to_string(string & result,const T& t);
50 | template
51 | out_type string_convert(const in_value & t);
52 |
53 | /** imagedealctrl */
54 | void imagedeal_closewindow(char *title);
55 | bool imagedeal_ispic(CString csType);
56 | void imagedeal_openpicdlg(CStringArray &csPath, int iCount = 0);
57 | int imagedeal_angle(CPoint center, CPoint startPoint, CPoint desPooint);
58 | int imagedeal_direction(CPoint startPoint, CPoint endPoint, CPoint cenPoint);
59 | void imagedeal_showimage(IplImage *image, CWnd* pWnd);
60 |
61 | /** windowsctrl */
62 | ULIB_RETURN windows_getmac(vector &v_mac);
63 | ULIB_RETURN windows_openURL(CString csUrl);
64 | void windows_filedlg(CString csFileFilter, CStringArray &csPath);
65 | void windows_transparentwnd(HWND hWnd,COLORREF clr,BYTE byAlpha,DWORD dwFlags);
66 | void windows_show2List(CListBox *pList, CString csMessage);
67 | void windows_setfont(CFont *pfont, long lHeight, CString csFaceName);
68 | void windows_setfont(CFont *pfont, long lHeight, long lWeight, CString csFaceName);
69 |
70 | /** pathctrl */
71 | ULIB_RETURN path_filename(string strPath, string &strfilename);
72 | ULIB_RETURN path_extension(string strPath, string &strextension);
73 | ULIB_RETURN path_stem(string strPath, string &strstem);
74 | ULIB_RETURN path_withoutfilename(string strPath, string &strDesPath);
75 |
76 | /** filectrl */
77 | ULIB_RETURN file_exist(string strPath, string &strError);
78 | ULIB_RETURN file_currentpath(string &strcurrentpath, string &strError);
79 | ULIB_RETURN file_remove(string strPath, string &strError);
80 | ULIB_RETURN file_creat(string strPath, string &strError);
81 | ULIB_RETURN file_initialpath(string &strcurrentpath, string &strError);
82 |
83 | protected:
84 |
85 | private:
86 | CCommTools(void){}
87 | ~CCommTools(void){}
88 | static CCommTools* m_Instance;
89 | };
90 |
91 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/prepared_statement.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 |
28 | #ifndef _SQL_PREPARED_STATEMENT_H_
29 | #define _SQL_PREPARED_STATEMENT_H_
30 |
31 | #include
32 | #include "statement.h"
33 |
34 |
35 | namespace sql
36 | {
37 |
38 | class Connection;
39 | class ResultSet;
40 | class ResultSetMetaData;
41 | class ParameterMetaData;
42 |
43 | class PreparedStatement : public Statement
44 | {
45 | public:
46 | virtual ~PreparedStatement() {}
47 |
48 | virtual void clearParameters() = 0;
49 |
50 | virtual bool execute(const sql::SQLString& sql) = 0;
51 | virtual bool execute() = 0;
52 |
53 | virtual ResultSet *executeQuery(const sql::SQLString& sql) = 0;
54 | virtual ResultSet *executeQuery() = 0;
55 |
56 | virtual int executeUpdate(const sql::SQLString& sql) = 0;
57 | virtual int executeUpdate() = 0;
58 |
59 | virtual ResultSetMetaData * getMetaData() = 0;
60 |
61 | virtual ParameterMetaData * getParameterMetaData() = 0;
62 |
63 | virtual bool getMoreResults() = 0;
64 |
65 | virtual void setBigInt(unsigned int parameterIndex, const sql::SQLString& value) = 0;
66 |
67 | virtual void setBlob(unsigned int parameterIndex, std::istream * blob) = 0;
68 |
69 | virtual void setBoolean(unsigned int parameterIndex, bool value) = 0;
70 |
71 | virtual void setDateTime(unsigned int parameterIndex, const sql::SQLString& value) = 0;
72 |
73 | virtual void setDouble(unsigned int parameterIndex, double value) = 0;
74 |
75 | virtual void setInt(unsigned int parameterIndex, int32_t value) = 0;
76 |
77 | virtual void setUInt(unsigned int parameterIndex, uint32_t value) = 0;
78 |
79 | virtual void setInt64(unsigned int parameterIndex, int64_t value) = 0;
80 |
81 | virtual void setUInt64(unsigned int parameterIndex, uint64_t value) = 0;
82 |
83 | virtual void setNull(unsigned int parameterIndex, int sqlType) = 0;
84 |
85 | virtual void setString(unsigned int parameterIndex, const sql::SQLString& value) = 0;
86 |
87 | virtual PreparedStatement * setResultSetType(sql::ResultSet::enum_type type) = 0;
88 | };
89 |
90 |
91 | } /* namespace sql */
92 |
93 | #endif /* _SQL_PREPARED_STATEMENT_H_ */
94 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/resultset_metadata.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_RESULTSET_METADATA_H_
28 | #define _SQL_RESULTSET_METADATA_H_
29 |
30 | #include "sqlstring.h"
31 | #include "datatype.h"
32 |
33 | namespace sql
34 | {
35 |
36 | class ResultSetMetaData
37 | {
38 | public:
39 | enum
40 | {
41 | columnNoNulls,
42 | columnNullable,
43 | columnNullableUnknown
44 | };
45 |
46 | virtual SQLString getCatalogName(unsigned int column) = 0;
47 |
48 | virtual unsigned int getColumnCount() = 0;
49 |
50 | virtual unsigned int getColumnDisplaySize(unsigned int column) = 0;
51 |
52 | virtual SQLString getColumnLabel(unsigned int column) = 0;
53 |
54 | virtual SQLString getColumnName(unsigned int column) = 0;
55 |
56 | virtual int getColumnType(unsigned int column) = 0;
57 |
58 | virtual SQLString getColumnTypeName(unsigned int column) = 0;
59 |
60 | virtual SQLString getColumnCharset(unsigned int columnIndex) = 0;
61 |
62 | virtual SQLString getColumnCollation(unsigned int columnIndex) = 0;
63 |
64 | virtual unsigned int getPrecision(unsigned int column) = 0;
65 |
66 | virtual unsigned int getScale(unsigned int column) = 0;
67 |
68 | virtual SQLString getSchemaName(unsigned int column) = 0;
69 |
70 | virtual SQLString getTableName(unsigned int column) = 0;
71 |
72 | virtual bool isAutoIncrement(unsigned int column) = 0;
73 |
74 | virtual bool isCaseSensitive(unsigned int column) = 0;
75 |
76 | virtual bool isCurrency(unsigned int column) = 0;
77 |
78 | virtual bool isDefinitelyWritable(unsigned int column) = 0;
79 |
80 | virtual int isNullable(unsigned int column) = 0;
81 |
82 | virtual bool isNumeric(unsigned int column) = 0;
83 |
84 | virtual bool isReadOnly(unsigned int column) = 0;
85 |
86 | virtual bool isSearchable(unsigned int column) = 0;
87 |
88 | virtual bool isSigned(unsigned int column) = 0;
89 |
90 | virtual bool isWritable(unsigned int column) = 0;
91 |
92 | virtual bool isZerofill(unsigned int column) = 0;
93 |
94 | protected:
95 | virtual ~ResultSetMetaData() {}
96 | };
97 |
98 |
99 | } /* namespace sql */
100 |
101 | #endif /* _SQL_RESULTSET_METADATA_H_ */
102 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/mysql_driver.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _MYSQL_DRIVER_H_
28 | #define _MYSQL_DRIVER_H_
29 |
30 | #include
31 |
32 | #include "mysql/cppconn/driver.h"
33 |
34 | extern "C"
35 | {
36 | CPPCONN_PUBLIC_FUNC void * sql_mysql_get_driver_instance();
37 | }
38 |
39 | namespace sql
40 | {
41 | namespace mysql
42 | {
43 | namespace NativeAPI
44 | {
45 | class NativeDriverWrapper;
46 | }
47 |
48 | //class sql::mysql::NativeAPI::NativeDriverWrapper;
49 |
50 | class CPPCONN_PUBLIC_FUNC MySQL_Driver : public sql::Driver
51 | {
52 | boost::scoped_ptr< ::sql::mysql::NativeAPI::NativeDriverWrapper > proxy;
53 |
54 | public:
55 | MySQL_Driver();
56 | MySQL_Driver(const ::sql::SQLString & clientLib);
57 |
58 | virtual ~MySQL_Driver();
59 |
60 | sql::Connection * connect(const sql::SQLString& hostName, const sql::SQLString& userName, const sql::SQLString& password);
61 |
62 | sql::Connection * connect(sql::ConnectOptionsMap & options);
63 |
64 | int getMajorVersion();
65 |
66 | int getMinorVersion();
67 |
68 | int getPatchVersion();
69 |
70 | const sql::SQLString & getName();
71 |
72 | void threadInit();
73 |
74 | void threadEnd();
75 |
76 | private:
77 | /* Prevent use of these */
78 | MySQL_Driver(const MySQL_Driver &);
79 | void operator=(MySQL_Driver &);
80 | };
81 |
82 | /** We do not hide the function if MYSQLCLIENT_STATIC_BINDING(or anything else) not defined
83 | because the counterpart C function is declared in the cppconn and is always visible.
84 | If dynamic loading is not enabled then its result is just like of get_driver_instance()
85 | */
86 | CPPCONN_PUBLIC_FUNC MySQL_Driver * get_driver_instance_by_name(const char * const clientlib);
87 |
88 | CPPCONN_PUBLIC_FUNC MySQL_Driver * get_driver_instance();
89 | static inline MySQL_Driver * get_mysql_driver_instance() { return get_driver_instance(); }
90 |
91 |
92 | } /* namespace mysql */
93 | } /* namespace sql */
94 |
95 | #endif // _MYSQL_DRIVER_H_
96 |
97 | /*
98 | * Local variables:
99 | * tab-width: 4
100 | * c-basic-offset: 4
101 | * End:
102 | * vim600: noet sw=4 ts=4 fdm=marker
103 | * vim<600: noet sw=4 ts=4
104 | */
105 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/config.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPL as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 | // libmysql defines HAVE_STRTOUL (on win), so we have to follow different pattern in definitions names
26 | // to avoid annoying warnings.
27 |
28 | /* #undef HAVE_FUNCTION_STRTOLD */
29 | /* #undef HAVE_FUNCTION_STRTOLL */
30 | #define HAVE_FUNCTION_STRTOL 1
31 | /* #undef HAVE_FUNCTION_STRTOULL */
32 |
33 | #define HAVE_FUNCTION_STRTOUL 1
34 |
35 | /* #undef HAVE_FUNCTION_STRTOIMAX */
36 | /* #undef HAVE_FUNCTION_STRTOUMAX */
37 |
38 | #define HAVE_STDINT_H 1
39 | /* #undef HAVE_INTTYPES_H */
40 |
41 | #define HAVE_INT8_T 1
42 | #define HAVE_UINT8_T 1
43 | #define HAVE_INT16_T 1
44 | #define HAVE_UINT16_T 1
45 | #define HAVE_INT32_T 1
46 | #define HAVE_UINT32_T 1
47 | #define HAVE_INT32_T 1
48 | #define HAVE_UINT32_T 1
49 | #define HAVE_INT64_T 1
50 | #define HAVE_UINT64_T 1
51 | #define HAVE_MS_INT8 1
52 | #define HAVE_MS_UINT8 1
53 | #define HAVE_MS_INT16 1
54 | #define HAVE_MS_UINT16 1
55 | #define HAVE_MS_INT32 1
56 | #define HAVE_MS_UINT32 1
57 | #define HAVE_MS_INT64 1
58 | #define HAVE_MS_UINT64 1
59 |
60 |
61 | #ifdef HAVE_STDINT_H
62 | #include
63 | #endif
64 |
65 | #ifdef HAVE_INTTYPES_H
66 | #include
67 | #endif
68 |
69 | #if defined(_WIN32)
70 | #ifndef CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES
71 |
72 | #if _MSC_VER >= 1600
73 |
74 | #include
75 |
76 | #else
77 |
78 | #if !defined(HAVE_INT8_T) && defined(HAVE_MS_INT8)
79 | typedef __int8 int8_t;
80 | #endif
81 |
82 | #ifdef HAVE_MS_UINT8
83 | typedef unsigned __int8 uint8_t;
84 | #endif
85 | #ifdef HAVE_MS_INT16
86 | typedef __int16 int16_t;
87 | #endif
88 |
89 | #ifdef HAVE_MS_UINT16
90 | typedef unsigned __int16 uint16_t;
91 | #endif
92 |
93 | #ifdef HAVE_MS_INT32
94 | typedef __int32 int32_t;
95 | #endif
96 |
97 | #ifdef HAVE_MS_UINT32
98 | typedef unsigned __int32 uint32_t;
99 | #endif
100 |
101 | #ifdef HAVE_MS_INT64
102 | typedef __int64 int64_t;
103 | #endif
104 | #ifdef HAVE_MS_UINT64
105 | typedef unsigned __int64 uint64_t;
106 | #endif
107 |
108 | #endif // _MSC_VER >= 1600
109 | #endif // CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES
110 | #endif // _WIN32
111 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/CSqliteCtrl.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "CSqliteCtrl.h"
3 |
4 |
5 | CSqliteCtrl::CSqliteCtrl(void)
6 | {
7 | m_csDB = _T("");
8 | m_bOpen = false;
9 | }
10 |
11 |
12 | CSqliteCtrl::~CSqliteCtrl(void)
13 | {
14 | }
15 |
16 | int CSqliteCtrl::Connect( CString csHost, CString csDB, CString csName /*= _T("")*/, CString csPwd /*=_T("")*/ )
17 | {
18 | int iRet = -1;
19 | try
20 | {
21 | m_db.open(csDB);
22 | }
23 | catch(CppSQLite3Exception e)
24 | {
25 | TRACE(e.errorMessage());
26 | return iRet;
27 | }
28 |
29 | m_bOpen = true;
30 | m_csDB = csDB;
31 | iRet = true;
32 |
33 | return iRet;
34 | }
35 |
36 | int CSqliteCtrl::Connect( CString csDB, CString csName /*= _T("")*/, CString csPwd /*=_T("")*/ )
37 | {
38 | int iRet = -1;
39 | try
40 | {
41 | m_db.open(csDB);
42 | }
43 | catch(CppSQLite3Exception e)
44 | {
45 | TRACE(e.errorMessage());
46 | return iRet;
47 | }
48 |
49 | m_bOpen = true;
50 | m_csDB = csDB;
51 | iRet = true;
52 |
53 | return iRet;
54 | }
55 |
56 | int CSqliteCtrl::CtrlData( CString csSql, CString csDB /*= _T("")*/ )
57 | {
58 | int iRet = ULIB_FALSE;
59 | try
60 | {
61 | iRet = m_db.execDML(csSql);
62 | if (iRet != SQLITE_OK)
63 | {
64 | return ULIB_FALSE;
65 | }
66 | //db.close();
67 |
68 | iRet = ULIB_TRUE;
69 | }
70 | catch(CppSQLite3Exception e)
71 | {
72 | TRACE(e.errorMessage());
73 | }
74 |
75 | return iRet;
76 | }
77 |
78 | int CSqliteCtrl::Close()
79 | {
80 | int iRet = -1;
81 |
82 | if( m_bOpen )
83 | {
84 | m_db.close();
85 | m_bOpen = false;
86 | iRet = true;
87 | }
88 |
89 | return iRet;
90 | }
91 |
92 | int CSqliteCtrl::DeleteTable( CString csTable, CString csDB /*= _T("")*/ )
93 | {
94 | int nRes = -1;
95 |
96 | try
97 | {
98 | CString csSql;
99 | csSql.Format(_T("drop table %s"), csTable);
100 | nRes = m_db.execDML(csSql);
101 | if (nRes != SQLITE_OK)
102 | {
103 | return nRes;
104 | }
105 | //db.close();
106 | }
107 | catch(CppSQLite3Exception e)
108 | {
109 | TRACE(e.errorMessage());
110 | }
111 |
112 | return nRes;
113 | }
114 |
115 | int CSqliteCtrl::SelectData( CFormatData &clsData, CString csDB )
116 | {
117 | int nRes = ULIB_FALSE;
118 |
119 | try
120 | {
121 | CString csSql;
122 | csSql.Format(_T("select * from %s"), clsData.m_csTable);
123 | CppSQLite3Query Query = m_db.execQuery(csSql);
124 | while ( !Query.eof() )
125 | {
126 | for ( int i = 0; i < clsData.m_vField.size(); i++ )
127 | {
128 | STDBDATA stData;
129 | stData.csTitle = clsData.m_vField[i];
130 | stData.csData = Query.getStringField(clsData.m_vField[i]);
131 | clsData.m_vData.push_back(stData);
132 | }
133 |
134 | Query.nextRow();
135 | }
136 |
137 | nRes = ULIB_TRUE;
138 | }
139 | catch(CppSQLite3Exception e)
140 | {
141 | TRACE(e.errorMessage());
142 | }
143 |
144 | return nRes;
145 | }
146 |
147 | int CSqliteCtrl::ClearTable( CString csTable, CString csDB /*= _T("")*/ )
148 | {
149 | int nRes = -1;
150 |
151 | try
152 | {
153 | CString csSql;
154 | csSql.Format(_T("delete from %s"), csTable);
155 | nRes = m_db.execDML(csSql);
156 | if (nRes != SQLITE_OK)
157 | {
158 | return nRes;
159 | }
160 | //db.close();
161 | }
162 | catch(CppSQLite3Exception e)
163 | {
164 | TRACE(e.errorMessage());
165 | }
166 |
167 | return nRes;
168 | }
169 |
--------------------------------------------------------------------------------
/UInterfaceLib/UInterfaceLib/mysql/cppconn/resultset.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
3 |
4 | The MySQL Connector/C++ is licensed under the terms of the GPLv2
5 | , like most
6 | MySQL Connectors. There are special exceptions to the terms and
7 | conditions of the GPLv2 as it is applied to this software, see the
8 | FLOSS License Exception
9 | .
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published
13 | by the Free Software Foundation; version 2 of the License.
14 |
15 | This program is distributed in the hope that it will be useful, but
16 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 | for more details.
19 |
20 | You should have received a copy of the GNU General Public License along
21 | with this program; if not, write to the Free Software Foundation, Inc.,
22 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 | */
24 |
25 |
26 |
27 | #ifndef _SQL_RESULTSET_H_
28 | #define _SQL_RESULTSET_H_
29 |
30 | #include "config.h"
31 |
32 | #include
33 | #include