├── .gitignore ├── LICENSE ├── README.md ├── UInterfaceLib ├── UInterfaceLib.sln └── UInterfaceLib │ ├── CCFileIni.cpp │ ├── CCFileIni.h │ ├── CCFileXml.cpp │ ├── CCFileXml.h │ ├── CCFtpCtrl.h │ ├── CCFtpCtrll.cpp │ ├── CCProjectInfo.cpp │ ├── CCProjectInfo.h │ ├── CCSoftUpdate.cpp │ ├── CCSoftUpdate.h │ ├── CCamDealData.cpp │ ├── CCamDealData.h │ ├── CCaptureVideo.cpp │ ├── CCaptureVideo.h │ ├── CConfigBase.cpp │ ├── CConfigBase.h │ ├── CDBbase.cpp │ ├── CDBbase.h │ ├── CDShowMessage.cpp │ ├── CDShowMessage.h │ ├── CExportExcel.cpp │ ├── CExportExcel.h │ ├── COwnerButton.cpp │ ├── COwnerButton.h │ ├── COwnerListBox.cpp │ ├── COwnerListBox.h │ ├── COwnerListCtrl.cpp │ ├── COwnerListCtrl.h │ ├── COwnerPicSta.cpp │ ├── COwnerPicSta.h │ ├── CSqliteCtrl.cpp │ ├── CSqliteCtrl.h │ ├── CommTools.cpp │ ├── CommTools.h │ ├── CvvImage.cpp │ ├── CvvImage.h │ ├── ReadMe.txt │ ├── SerialTools │ ├── CCmdStation.cpp │ ├── CCmdStation.h │ ├── CSerialCom.cpp │ └── CSerialCom.h │ ├── UCommonToolsDefine.h │ ├── UInterfaceLib.aps │ ├── UInterfaceLib.cpp │ ├── UInterfaceLib.def │ ├── UInterfaceLib.h │ ├── UInterfaceLib.rc │ ├── UInterfaceLib.vcxproj │ ├── UInterfaceLib.vcxproj.filters │ ├── UInterfaceLib.vcxproj.user │ ├── ULib.h │ ├── UMessageDlgDefine.h │ ├── UOwnCtrlDefine.h │ ├── excel │ ├── CApplication.h │ ├── CRange.h │ ├── CWorkbook.h │ ├── CWorkbooks.h │ ├── CWorksheet.h │ └── CWorksheets.h │ ├── export_include │ ├── UCommonToolsDefine.h │ ├── UDataBase.h │ ├── UInterface.h │ └── UOwnCtrlDefine.h │ ├── mysql │ ├── cppconn │ │ ├── build_config.h │ │ ├── config.h │ │ ├── connection.h │ │ ├── datatype.h │ │ ├── driver.h │ │ ├── exception.h │ │ ├── metadata.h │ │ ├── parameter_metadata.h │ │ ├── prepared_statement.h │ │ ├── resultset.h │ │ ├── resultset_metadata.h │ │ ├── sqlstring.h │ │ ├── statement.h │ │ ├── variant.h │ │ ├── version_info.h │ │ └── warning.h │ ├── mysql_connection.h │ ├── mysql_driver.h │ └── mysql_error.h │ ├── res │ ├── UI-RBAS.ico │ └── UInterfaceLib.rc2 │ ├── resource.h │ ├── sqlite │ ├── CppSQLite3U.cpp │ ├── CppSQLite3U.h │ └── sqlite3.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h └── UiCommTools ├── UiCommTools.sln └── UiCommTools ├── CDShowMessage.cpp ├── CDShowMessage.h ├── CExportExcel.cpp ├── CExportExcel.h ├── CommTools.cpp ├── CommTools.h ├── ReadMe.txt ├── ULib.h ├── UiCommTools.aps ├── UiCommTools.cpp ├── UiCommTools.def ├── UiCommTools.h ├── UiCommTools.rc ├── UiCommTools.vcxproj ├── UiCommTools.vcxproj.filters ├── UiCommTools.vcxproj.user ├── res └── UiCommTools.rc2 ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UInterfaceLib 2 | c++工具以及mfc界面库 3 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/CCFtpCtrll.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CCFtpCtrll.cpp -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/CCProjectInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CCProjectInfo.cpp -------------------------------------------------------------------------------- /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/CCSoftUpdate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CCSoftUpdate.cpp -------------------------------------------------------------------------------- /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/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/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/CCaptureVideo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CCaptureVideo.cpp -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/CCaptureVideo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CCaptureVideo.h -------------------------------------------------------------------------------- /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/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/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/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/CDShowMessage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CDShowMessage.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/CExportExcel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CExportExcel.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/COwnerButton.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/COwnerButton.cpp -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/COwnerButton.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/COwnerButton.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/COwnerListBox.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/COwnerListBox.cpp -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/COwnerListBox.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/COwnerListBox.h -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/COwnerPicSta.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/COwnerPicSta.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/CommTools.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/CommTools.cpp -------------------------------------------------------------------------------- /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/CvvImage.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "CvvImage.h" 3 | ////////////////////////////////////////////////////////////////////// 4 | // Construction/Destruction 5 | ////////////////////////////////////////////////////////////////////// 6 | CV_INLINE RECT NormalizeRect( RECT r ); 7 | CV_INLINE RECT NormalizeRect( RECT r ) 8 | { 9 | int t; 10 | if( r.left > r.right ) 11 | { 12 | t = r.left; 13 | r.left = r.right; 14 | r.right = t; 15 | } 16 | if( r.top > r.bottom ) 17 | { 18 | t = r.top; 19 | r.top = r.bottom; 20 | r.bottom = t; 21 | } 22 | 23 | return r; 24 | } 25 | CV_INLINE CvRect RectToCvRect( RECT sr ); 26 | CV_INLINE CvRect RectToCvRect( RECT sr ) 27 | { 28 | sr = NormalizeRect( sr ); 29 | return cvRect( sr.left, sr.top, sr.right - sr.left, sr.bottom - sr.top ); 30 | } 31 | CV_INLINE RECT CvRectToRect( CvRect sr ); 32 | CV_INLINE RECT CvRectToRect( CvRect sr ) 33 | { 34 | RECT dr; 35 | dr.left = sr.x; 36 | dr.top = sr.y; 37 | dr.right = sr.x + sr.width; 38 | dr.bottom = sr.y + sr.height; 39 | 40 | return dr; 41 | } 42 | CV_INLINE IplROI RectToROI( RECT r ); 43 | CV_INLINE IplROI RectToROI( RECT r ) 44 | { 45 | IplROI roi; 46 | r = NormalizeRect( r ); 47 | roi.xOffset = r.left; 48 | roi.yOffset = r.top; 49 | roi.width = r.right - r.left; 50 | roi.height = r.bottom - r.top; 51 | roi.coi = 0; 52 | 53 | return roi; 54 | } 55 | void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ) 56 | { 57 | assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32)); 58 | 59 | BITMAPINFOHEADER* bmih = &(bmi->bmiHeader); 60 | 61 | memset( bmih, 0, sizeof(*bmih)); 62 | bmih->biSize = sizeof(BITMAPINFOHEADER); 63 | bmih->biWidth = width; 64 | bmih->biHeight = origin ? abs(height) : -abs(height); 65 | bmih->biPlanes = 1; 66 | bmih->biBitCount = (unsigned short)bpp; 67 | bmih->biCompression = BI_RGB; 68 | if( bpp == 8 ) 69 | { 70 | RGBQUAD* palette = bmi->bmiColors; 71 | int i; 72 | for( i = 0; i < 256; i++ ) 73 | { 74 | palette[i].rgbBlue = palette[i].rgbGreen = palette[i].rgbRed = (BYTE)i; 75 | palette[i].rgbReserved = 0; 76 | } 77 | } 78 | } 79 | CvvImage::CvvImage() 80 | { 81 | m_img = 0; 82 | } 83 | void CvvImage::Destroy() 84 | { 85 | cvReleaseImage( &m_img ); 86 | } 87 | CvvImage::~CvvImage() 88 | { 89 | Destroy(); 90 | } 91 | bool CvvImage::Create( int w, int h, int bpp, int origin ) 92 | { 93 | const unsigned max_img_size = 10000; 94 | 95 | if( (bpp != 8 && bpp != 24 && bpp != 32) || 96 | (unsigned)w >= max_img_size || (unsigned)h >= max_img_size || 97 | (origin != IPL_ORIGIN_TL && origin != IPL_ORIGIN_BL)) 98 | { 99 | assert(0); // most probably, it is a programming error 100 | return false; 101 | } 102 | if( !m_img || Bpp() != bpp || m_img->width != w || m_img->height != h ) 103 | { 104 | if( m_img && m_img->nSize == sizeof(IplImage)) 105 | Destroy(); 106 | /* prepare IPL header */ 107 | m_img = cvCreateImage( cvSize( w, h ), IPL_DEPTH_8U, bpp/8 ); 108 | } 109 | if( m_img ) 110 | m_img->origin = origin == 0 ? IPL_ORIGIN_TL : IPL_ORIGIN_BL; 111 | return m_img != 0; 112 | } 113 | void CvvImage::CopyOf( CvvImage& image, int desired_color ) 114 | { 115 | IplImage* img = image.GetImage(); 116 | if( img ) 117 | { 118 | CopyOf( img, desired_color ); 119 | } 120 | } 121 | #define HG_IS_IMAGE(img) \ 122 | ((img) != 0 && ((const IplImage*)(img))->nSize == sizeof(IplImage) && \ 123 | ((IplImage*)img)->imageData != 0) 124 | void CvvImage::CopyOf( IplImage* img, int desired_color ) 125 | { 126 | if( HG_IS_IMAGE(img) ) 127 | { 128 | int color = desired_color; 129 | CvSize size = cvGetSize( img ); 130 | if( color < 0 ) 131 | color = img->nChannels > 1; 132 | if( Create( size.width, size.height, 133 | (!color ? 1 : img->nChannels > 1 ? img->nChannels : 3)*8, 134 | img->origin )) 135 | { 136 | cvConvertImage( img, m_img, 0 ); 137 | } 138 | } 139 | } 140 | bool CvvImage::Load( const char* filename, int desired_color ) 141 | { 142 | IplImage* img = cvLoadImage( filename, desired_color ); 143 | if( !img ) 144 | return false; 145 | 146 | CopyOf( img, desired_color ); 147 | cvReleaseImage( &img ); 148 | 149 | return true; 150 | } 151 | bool CvvImage::LoadRect( const char* filename, 152 | int desired_color, CvRect r ) 153 | { 154 | if( r.width < 0 || r.height < 0 ) return false; 155 | 156 | IplImage* img = cvLoadImage( filename, desired_color ); 157 | if( !img ) 158 | return false; 159 | if( r.width == 0 || r.height == 0 ) 160 | { 161 | r.width = img->width; 162 | r.height = img->height; 163 | r.x = r.y = 0; 164 | } 165 | if( r.x > img->width || r.y > img->height || 166 | r.x + r.width < 0 || r.y + r.height < 0 ) 167 | { 168 | cvReleaseImage( &img ); 169 | return false; 170 | } 171 | /* truncate r to source image */ 172 | if( r.x < 0 ) 173 | { 174 | r.width += r.x; 175 | r.x = 0; 176 | } 177 | if( r.y < 0 ) 178 | { 179 | r.height += r.y; 180 | r.y = 0; 181 | } 182 | if( r.x + r.width > img->width ) 183 | r.width = img->width - r.x; 184 | 185 | if( r.y + r.height > img->height ) 186 | r.height = img->height - r.y; 187 | cvSetImageROI( img, r ); 188 | CopyOf( img, desired_color ); 189 | cvReleaseImage( &img ); 190 | return true; 191 | } 192 | bool CvvImage::Save( const char* filename ) 193 | { 194 | if( !m_img ) 195 | return false; 196 | cvSaveImage( filename, m_img ); 197 | return true; 198 | } 199 | void CvvImage::Show( const char* window ) 200 | { 201 | if( m_img ) 202 | cvShowImage( window, m_img ); 203 | } 204 | void CvvImage::Show( HDC dc, int x, int y, int w, int h, int from_x, int from_y ) 205 | { 206 | if( m_img && m_img->depth == IPL_DEPTH_8U ) 207 | { 208 | uchar buffer[sizeof(BITMAPINFOHEADER) + 1024]; 209 | BITMAPINFO* bmi = (BITMAPINFO*)buffer; 210 | int bmp_w = m_img->width, bmp_h = m_img->height; 211 | FillBitmapInfo( bmi, bmp_w, bmp_h, Bpp(), m_img->origin ); 212 | from_x = MIN( MAX( from_x, 0 ), bmp_w - 1 ); 213 | from_y = MIN( MAX( from_y, 0 ), bmp_h - 1 ); 214 | int sw = MAX( MIN( bmp_w - from_x, w ), 0 ); 215 | int sh = MAX( MIN( bmp_h - from_y, h ), 0 ); 216 | SetDIBitsToDevice( 217 | dc, x, y, sw, sh, from_x, from_y, from_y, sh, 218 | m_img->imageData + from_y*m_img->widthStep, 219 | bmi, DIB_RGB_COLORS ); 220 | } 221 | } 222 | void CvvImage::DrawToHDC( HDC hDCDst, RECT* pDstRect ) 223 | { 224 | if( pDstRect && m_img && m_img->depth == IPL_DEPTH_8U && m_img->imageData ) 225 | { 226 | uchar buffer[sizeof(BITMAPINFOHEADER) + 1024]; 227 | BITMAPINFO* bmi = (BITMAPINFO*)buffer; 228 | int bmp_w = m_img->width, bmp_h = m_img->height; 229 | CvRect roi = cvGetImageROI( m_img ); 230 | CvRect dst = RectToCvRect( *pDstRect ); 231 | if( roi.width == dst.width && roi.height == dst.height ) 232 | { 233 | Show( hDCDst, dst.x, dst.y, dst.width, dst.height, roi.x, roi.y ); 234 | return; 235 | } 236 | if( roi.width > dst.width ) 237 | { 238 | SetStretchBltMode( 239 | hDCDst, // handle to device context 240 | HALFTONE ); 241 | } 242 | else 243 | { 244 | SetStretchBltMode( 245 | hDCDst, // handle to device context 246 | COLORONCOLOR ); 247 | } 248 | FillBitmapInfo( bmi, bmp_w, bmp_h, Bpp(), m_img->origin ); 249 | ::StretchDIBits( 250 | hDCDst, 251 | dst.x, dst.y, dst.width, dst.height, 252 | roi.x, roi.y, roi.width, roi.height, 253 | m_img->imageData, bmi, DIB_RGB_COLORS, SRCCOPY ); 254 | } 255 | } 256 | void CvvImage::Fill( int color ) 257 | { 258 | cvSet( m_img, cvScalar(color&255,(color>>8)&255,(color>>16)&255,(color>>24)&255) ); 259 | } 260 | -------------------------------------------------------------------------------- /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/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/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/SerialTools/CCmdStation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/SerialTools/CCmdStation.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.cpp -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/SerialTools/CSerialCom.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UCommonToolsDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/UCommonToolsDefine.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UInterfaceLib.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/UInterfaceLib.aps -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/UInterfaceLib.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/UInterfaceLib.rc -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UInterfaceLib.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {3709FFBE-3A6F-45E3-87A6-6D7421E380DD} 15 | UInterfaceLib 16 | MFCDLLProj 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | Unicode 23 | Dynamic 24 | 25 | 26 | DynamicLibrary 27 | false 28 | true 29 | Unicode 30 | Dynamic 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | $(FrameworkSDKDir)\include;E:\DXSDK\Samples\C++\DirectShow\BaseClasses;E:\DXSDK\Include;E:\Opencv%282.4.8%29\opencv\build\include;E:\Opencv%282.4.8%29\opencv\build\include\opencv2;E:\Opencv%282.4.8%29\opencv\build\include\opencv;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;E:\boost_1_58_0 45 | E:\DXSDK\Lib;E:\boost_1_58_0\vc2010\lib;E:\Opencv%282.4.8%29\opencv\build\x86\vc10\lib;E:\Opencv%282.4.8%29\opencv\build\x86\vc10\staticlib;$(LibraryPath) 46 | 47 | 48 | false 49 | $(FrameworkSDKDir)\include;E:\DXSDK\Samples\C++\DirectShow\BaseClasses;E:\DXSDK\Include;E:\Opencv%282.4.8%29\opencv\build\include;E:\Opencv%282.4.8%29\opencv\build\include\opencv2;E:\Opencv%282.4.8%29\opencv\build\include\opencv;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;E:\boost_1_58_0 50 | E:\DXSDK\Lib;E:\boost_1_58_0\vc2010\lib;E:\Opencv%282.4.8%29\opencv\build\x86\vc10\lib;E:\Opencv%282.4.8%29\opencv\build\x86\vc10\staticlib;$(LibraryPath) 51 | 52 | 53 | 54 | Use 55 | Level3 56 | Disabled 57 | WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) 58 | MultiThreadedDebugDLL 59 | -Zm200 %(AdditionalOptions) 60 | 61 | 62 | Windows 63 | true 64 | .\UInterfaceLib.def 65 | F:\软件开发\P_PC\K 界面库\UInterfaceLib\UInterfaceLib\mysql;%(AdditionalLibraryDirectories) 66 | mysqlcppconn.lib;mysqlcppconn-static.lib;%(AdditionalDependencies) 67 | 68 | 69 | false 70 | _DEBUG;%(PreprocessorDefinitions) 71 | 72 | 73 | 0x0409 74 | _DEBUG;%(PreprocessorDefinitions) 75 | $(IntDir);%(AdditionalIncludeDirectories) 76 | 77 | 78 | 79 | 80 | Level3 81 | Use 82 | MaxSpeed 83 | true 84 | true 85 | WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) 86 | -Zm150 %(AdditionalOptions) 87 | 88 | 89 | Windows 90 | true 91 | true 92 | true 93 | .\UInterfaceLib.def 94 | .\mysql;%(AdditionalLibraryDirectories) 95 | mysqlcppconn.lib;mysqlcppconn-static.lib;%(AdditionalDependencies) 96 | true 97 | 98 | 99 | false 100 | NDEBUG;%(PreprocessorDefinitions) 101 | 102 | 103 | 0x0409 104 | NDEBUG;%(PreprocessorDefinitions) 105 | $(IntDir);%(AdditionalIncludeDirectories) 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | Create 138 | Create 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UInterfaceLib.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 | {c70e1d14-98f8-4b6b-82d7-b6190436cede} 18 | 19 | 20 | {8a303a56-98e3-4f21-a65b-0641ff0d5d1c} 21 | 22 | 23 | {9493a55f-5c53-400e-abc3-a4354755daa3} 24 | 25 | 26 | {a18b9472-ae90-4ce0-ba16-33d393563996} 27 | 28 | 29 | {ebbb51db-2502-4356-a650-e11fac53694c} 30 | 31 | 32 | {1e3b54fa-ad32-4097-9161-ff01b26fb3bf} 33 | 34 | 35 | {f5b58cbf-9c23-4df0-8471-f19dce5cf3ce} 36 | 37 | 38 | {2ae5fb12-e337-4f21-be76-9073ef508087} 39 | 40 | 41 | {f57e6fca-969a-4cdd-82e1-b58b6188223a} 42 | 43 | 44 | {d5685d27-42be-4819-9726-7aac4bfdd4bd} 45 | 46 | 47 | {9a3b0738-be46-49f7-948b-2d96df64cb08} 48 | 49 | 50 | {435e1a27-1f57-453e-a1cc-9c094400a8a4} 51 | 52 | 53 | 54 | 55 | 56 | Source Files 57 | 58 | 59 | Resource Files 60 | 61 | 62 | Resource Files 63 | 64 | 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | ConfigFile 74 | 75 | 76 | ConfigFile 77 | 78 | 79 | ConfigFile 80 | 81 | 82 | DataBase 83 | 84 | 85 | DataBase 86 | 87 | 88 | Cam 89 | 90 | 91 | Cam 92 | 93 | 94 | OwnTools 95 | 96 | 97 | OwnTools 98 | 99 | 100 | OwnTools 101 | 102 | 103 | OwnTools 104 | 105 | 106 | OwnTools 107 | 108 | 109 | Net 110 | 111 | 112 | SoftWare 113 | 114 | 115 | SoftWare 116 | 117 | 118 | DataBase 119 | 120 | 121 | CommTools 122 | 123 | 124 | CommTools 125 | 126 | 127 | Private 128 | 129 | 130 | SerialTools 131 | 132 | 133 | SerialTools 134 | 135 | 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | DataBase\SQLite 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files\include 157 | 158 | 159 | Header Files\include 160 | 161 | 162 | Header Files\include 163 | 164 | 165 | Header Files\include 166 | 167 | 168 | ConfigFile 169 | 170 | 171 | ConfigFile 172 | 173 | 174 | ConfigFile 175 | 176 | 177 | DataBase 178 | 179 | 180 | DataBase 181 | 182 | 183 | Cam 184 | 185 | 186 | Cam 187 | 188 | 189 | OwnTools 190 | 191 | 192 | OwnTools 193 | 194 | 195 | OwnTools 196 | 197 | 198 | OwnTools 199 | 200 | 201 | OwnTools 202 | 203 | 204 | Net 205 | 206 | 207 | Private 208 | 209 | 210 | SoftWare 211 | 212 | 213 | SoftWare 214 | 215 | 216 | CommTools 217 | 218 | 219 | CommTools 220 | 221 | 222 | SerialTools 223 | 224 | 225 | SerialTools 226 | 227 | 228 | 229 | 230 | Resource Files 231 | 232 | 233 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UInterfaceLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/ULib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/ULib.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UMessageDlgDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/UMessageDlgDefine.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/UOwnCtrlDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/UOwnCtrlDefine.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/excel/CWorkbooks.h: -------------------------------------------------------------------------------- 1 | // Machine generated IDispatch wrapper class(es) created with Add Class from Typelib Wizard 2 | 3 | // CWorkbooks wrapper class 4 | 5 | class CWorkbooks : public COleDispatchDriver 6 | { 7 | public: 8 | CWorkbooks(){} // Calls COleDispatchDriver default constructor 9 | CWorkbooks(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} 10 | CWorkbooks(const CWorkbooks& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} 11 | 12 | // Attributes 13 | public: 14 | 15 | // Operations 16 | public: 17 | 18 | 19 | // Workbooks methods 20 | public: 21 | LPDISPATCH get_Application() 22 | { 23 | LPDISPATCH result; 24 | InvokeHelper(0x94, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 25 | return result; 26 | } 27 | long get_Creator() 28 | { 29 | long result; 30 | InvokeHelper(0x95, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); 31 | return result; 32 | } 33 | LPDISPATCH get_Parent() 34 | { 35 | LPDISPATCH result; 36 | InvokeHelper(0x96, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 37 | return result; 38 | } 39 | LPDISPATCH Add(VARIANT& Template) 40 | { 41 | LPDISPATCH result; 42 | static BYTE parms[] = VTS_VARIANT ; 43 | InvokeHelper(0xb5, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, &Template); 44 | return result; 45 | } 46 | void Close() 47 | { 48 | InvokeHelper(0x115, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); 49 | } 50 | long get_Count() 51 | { 52 | long result; 53 | InvokeHelper(0x76, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); 54 | return result; 55 | } 56 | LPDISPATCH get_Item(VARIANT& Index) 57 | { 58 | LPDISPATCH result; 59 | static BYTE parms[] = VTS_VARIANT ; 60 | InvokeHelper(0xaa, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, parms, &Index); 61 | return result; 62 | } 63 | LPUNKNOWN get__NewEnum() 64 | { 65 | LPUNKNOWN result; 66 | InvokeHelper(0xfffffffc, DISPATCH_PROPERTYGET, VT_UNKNOWN, (void*)&result, NULL); 67 | return result; 68 | } 69 | LPDISPATCH _Open(LPCTSTR Filename, VARIANT& UpdateLinks, VARIANT& ReadOnly, VARIANT& Format, VARIANT& Password, VARIANT& WriteResPassword, VARIANT& IgnoreReadOnlyRecommended, VARIANT& Origin, VARIANT& Delimiter, VARIANT& Editable, VARIANT& Notify, VARIANT& Converter, VARIANT& AddToMru) 70 | { 71 | LPDISPATCH result; 72 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 73 | InvokeHelper(0x2aa, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, Filename, &UpdateLinks, &ReadOnly, &Format, &Password, &WriteResPassword, &IgnoreReadOnlyRecommended, &Origin, &Delimiter, &Editable, &Notify, &Converter, &AddToMru); 74 | return result; 75 | } 76 | void __OpenText(LPCTSTR Filename, VARIANT& Origin, VARIANT& StartRow, VARIANT& DataType, long TextQualifier, VARIANT& ConsecutiveDelimiter, VARIANT& Tab, VARIANT& Semicolon, VARIANT& Comma, VARIANT& Space, VARIANT& Other, VARIANT& OtherChar, VARIANT& FieldInfo, VARIANT& TextVisualLayout) 77 | { 78 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_I4 VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 79 | InvokeHelper(0x2ab, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Filename, &Origin, &StartRow, &DataType, TextQualifier, &ConsecutiveDelimiter, &Tab, &Semicolon, &Comma, &Space, &Other, &OtherChar, &FieldInfo, &TextVisualLayout); 80 | } 81 | LPDISPATCH get__Default(VARIANT& Index) 82 | { 83 | LPDISPATCH result; 84 | static BYTE parms[] = VTS_VARIANT ; 85 | InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, parms, &Index); 86 | return result; 87 | } 88 | void _OpenText(LPCTSTR Filename, VARIANT& Origin, VARIANT& StartRow, VARIANT& DataType, long TextQualifier, VARIANT& ConsecutiveDelimiter, VARIANT& Tab, VARIANT& Semicolon, VARIANT& Comma, VARIANT& Space, VARIANT& Other, VARIANT& OtherChar, VARIANT& FieldInfo, VARIANT& TextVisualLayout, VARIANT& DecimalSeparator, VARIANT& ThousandsSeparator) 89 | { 90 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_I4 VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 91 | InvokeHelper(0x6ed, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Filename, &Origin, &StartRow, &DataType, TextQualifier, &ConsecutiveDelimiter, &Tab, &Semicolon, &Comma, &Space, &Other, &OtherChar, &FieldInfo, &TextVisualLayout, &DecimalSeparator, &ThousandsSeparator); 92 | } 93 | LPDISPATCH Open(LPCTSTR Filename, VARIANT& UpdateLinks, VARIANT& ReadOnly, VARIANT& Format, VARIANT& Password, VARIANT& WriteResPassword, VARIANT& IgnoreReadOnlyRecommended, VARIANT& Origin, VARIANT& Delimiter, VARIANT& Editable, VARIANT& Notify, VARIANT& Converter, VARIANT& AddToMru, VARIANT& Local, VARIANT& CorruptLoad) 94 | { 95 | LPDISPATCH result; 96 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 97 | InvokeHelper(0x783, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, Filename, &UpdateLinks, &ReadOnly, &Format, &Password, &WriteResPassword, &IgnoreReadOnlyRecommended, &Origin, &Delimiter, &Editable, &Notify, &Converter, &AddToMru, &Local, &CorruptLoad); 98 | return result; 99 | } 100 | void OpenText(LPCTSTR Filename, VARIANT& Origin, VARIANT& StartRow, VARIANT& DataType, long TextQualifier, VARIANT& ConsecutiveDelimiter, VARIANT& Tab, VARIANT& Semicolon, VARIANT& Comma, VARIANT& Space, VARIANT& Other, VARIANT& OtherChar, VARIANT& FieldInfo, VARIANT& TextVisualLayout, VARIANT& DecimalSeparator, VARIANT& ThousandsSeparator, VARIANT& TrailingMinusNumbers, VARIANT& Local) 101 | { 102 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_I4 VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 103 | InvokeHelper(0x784, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Filename, &Origin, &StartRow, &DataType, TextQualifier, &ConsecutiveDelimiter, &Tab, &Semicolon, &Comma, &Space, &Other, &OtherChar, &FieldInfo, &TextVisualLayout, &DecimalSeparator, &ThousandsSeparator, &TrailingMinusNumbers, &Local); 104 | } 105 | LPDISPATCH OpenDatabase(LPCTSTR Filename, VARIANT& CommandText, VARIANT& CommandType, VARIANT& BackgroundQuery, VARIANT& ImportDataAs) 106 | { 107 | LPDISPATCH result; 108 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 109 | InvokeHelper(0x813, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, Filename, &CommandText, &CommandType, &BackgroundQuery, &ImportDataAs); 110 | return result; 111 | } 112 | void CheckOut(LPCTSTR Filename) 113 | { 114 | static BYTE parms[] = VTS_BSTR ; 115 | InvokeHelper(0x815, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Filename); 116 | } 117 | BOOL CanCheckOut(LPCTSTR Filename) 118 | { 119 | BOOL result; 120 | static BYTE parms[] = VTS_BSTR ; 121 | InvokeHelper(0x816, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms, Filename); 122 | return result; 123 | } 124 | LPDISPATCH _OpenXML(LPCTSTR Filename, VARIANT& Stylesheets) 125 | { 126 | LPDISPATCH result; 127 | static BYTE parms[] = VTS_BSTR VTS_VARIANT ; 128 | InvokeHelper(0x817, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, Filename, &Stylesheets); 129 | return result; 130 | } 131 | LPDISPATCH OpenXML(LPCTSTR Filename, VARIANT& Stylesheets, VARIANT& LoadOption) 132 | { 133 | LPDISPATCH result; 134 | static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_VARIANT ; 135 | InvokeHelper(0x8e8, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, Filename, &Stylesheets, &LoadOption); 136 | return result; 137 | } 138 | 139 | // Workbooks properties 140 | public: 141 | 142 | }; 143 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/excel/CWorksheets.h: -------------------------------------------------------------------------------- 1 | // Machine generated IDispatch wrapper class(es) created with Add Class from Typelib Wizard 2 | 3 | // CWorksheets wrapper class 4 | 5 | class CWorksheets : public COleDispatchDriver 6 | { 7 | public: 8 | CWorksheets(){} // Calls COleDispatchDriver default constructor 9 | CWorksheets(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} 10 | CWorksheets(const CWorksheets& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} 11 | 12 | // Attributes 13 | public: 14 | 15 | // Operations 16 | public: 17 | 18 | 19 | // Worksheets methods 20 | public: 21 | LPDISPATCH get_Application() 22 | { 23 | LPDISPATCH result; 24 | InvokeHelper(0x94, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 25 | return result; 26 | } 27 | long get_Creator() 28 | { 29 | long result; 30 | InvokeHelper(0x95, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); 31 | return result; 32 | } 33 | LPDISPATCH get_Parent() 34 | { 35 | LPDISPATCH result; 36 | InvokeHelper(0x96, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 37 | return result; 38 | } 39 | LPDISPATCH Add(VARIANT& Before, VARIANT& After, VARIANT& Count, VARIANT& Type) 40 | { 41 | LPDISPATCH result; 42 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 43 | InvokeHelper(0xb5, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, &Before, &After, &Count, &Type); 44 | return result; 45 | } 46 | void Copy(VARIANT& Before, VARIANT& After) 47 | { 48 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT ; 49 | InvokeHelper(0x227, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &Before, &After); 50 | } 51 | long get_Count() 52 | { 53 | long result; 54 | InvokeHelper(0x76, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); 55 | return result; 56 | } 57 | void Delete() 58 | { 59 | InvokeHelper(0x75, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); 60 | } 61 | void FillAcrossSheets(LPDISPATCH Range, long Type) 62 | { 63 | static BYTE parms[] = VTS_DISPATCH VTS_I4 ; 64 | InvokeHelper(0x1d5, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Range, Type); 65 | } 66 | LPDISPATCH get_Item(VARIANT& Index) 67 | { 68 | LPDISPATCH result; 69 | static BYTE parms[] = VTS_VARIANT ; 70 | InvokeHelper(0xaa, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, parms, &Index); 71 | return result; 72 | } 73 | void Move(VARIANT& Before, VARIANT& After) 74 | { 75 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT ; 76 | InvokeHelper(0x27d, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &Before, &After); 77 | } 78 | LPUNKNOWN get__NewEnum() 79 | { 80 | LPUNKNOWN result; 81 | InvokeHelper(0xfffffffc, DISPATCH_PROPERTYGET, VT_UNKNOWN, (void*)&result, NULL); 82 | return result; 83 | } 84 | void __PrintOut(VARIANT& From, VARIANT& To, VARIANT& Copies, VARIANT& Preview, VARIANT& ActivePrinter, VARIANT& PrintToFile, VARIANT& Collate) 85 | { 86 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 87 | InvokeHelper(0x389, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &From, &To, &Copies, &Preview, &ActivePrinter, &PrintToFile, &Collate); 88 | } 89 | void PrintPreview(VARIANT& EnableChanges) 90 | { 91 | static BYTE parms[] = VTS_VARIANT ; 92 | InvokeHelper(0x119, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &EnableChanges); 93 | } 94 | void Select(VARIANT& Replace) 95 | { 96 | static BYTE parms[] = VTS_VARIANT ; 97 | InvokeHelper(0xeb, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &Replace); 98 | } 99 | LPDISPATCH get_HPageBreaks() 100 | { 101 | LPDISPATCH result; 102 | InvokeHelper(0x58a, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 103 | return result; 104 | } 105 | LPDISPATCH get_VPageBreaks() 106 | { 107 | LPDISPATCH result; 108 | InvokeHelper(0x58b, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); 109 | return result; 110 | } 111 | VARIANT get_Visible() 112 | { 113 | VARIANT result; 114 | InvokeHelper(0x22e, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL); 115 | return result; 116 | } 117 | void put_Visible(VARIANT& newValue) 118 | { 119 | static BYTE parms[] = VTS_VARIANT ; 120 | InvokeHelper(0x22e, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, &newValue); 121 | } 122 | LPDISPATCH get__Default(VARIANT& Index) 123 | { 124 | LPDISPATCH result; 125 | static BYTE parms[] = VTS_VARIANT ; 126 | InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, parms, &Index); 127 | return result; 128 | } 129 | void _PrintOut(VARIANT& From, VARIANT& To, VARIANT& Copies, VARIANT& Preview, VARIANT& ActivePrinter, VARIANT& PrintToFile, VARIANT& Collate, VARIANT& PrToFileName) 130 | { 131 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 132 | InvokeHelper(0x6ec, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &From, &To, &Copies, &Preview, &ActivePrinter, &PrintToFile, &Collate, &PrToFileName); 133 | } 134 | void PrintOut(VARIANT& From, VARIANT& To, VARIANT& Copies, VARIANT& Preview, VARIANT& ActivePrinter, VARIANT& PrintToFile, VARIANT& Collate, VARIANT& PrToFileName, VARIANT& IgnorePrintAreas) 135 | { 136 | static BYTE parms[] = VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT VTS_VARIANT ; 137 | InvokeHelper(0x939, DISPATCH_METHOD, VT_EMPTY, NULL, parms, &From, &To, &Copies, &Preview, &ActivePrinter, &PrintToFile, &Collate, &PrToFileName, &IgnorePrintAreas); 138 | } 139 | 140 | // Worksheets properties 141 | public: 142 | 143 | }; 144 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/export_include/UCommonToolsDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/export_include/UCommonToolsDefine.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 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/export_include/UInterface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/export_include/UInterface.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/export_include/UOwnCtrlDefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/export_include/UOwnCtrlDefine.h -------------------------------------------------------------------------------- /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/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/mysql/cppconn/connection.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_CONNECTION_H_ 28 | #define _SQL_CONNECTION_H_ 29 | 30 | #include 31 | 32 | #include "mysql/cppconn/build_config.h" 33 | #include "mysql/cppconn/warning.h" 34 | #include "mysql/cppconn/sqlstring.h" 35 | #include "mysql/cppconn/variant.h" 36 | #include "mysql/cppconn/statement.h" 37 | 38 | namespace sql 39 | { 40 | 41 | typedef sql::Variant ConnectPropertyVal; 42 | 43 | typedef std::map< sql::SQLString, ConnectPropertyVal > ConnectOptionsMap; 44 | 45 | class DatabaseMetaData; 46 | class PreparedStatement; 47 | class Statement; 48 | class Driver; 49 | 50 | typedef enum transaction_isolation 51 | { 52 | TRANSACTION_NONE= 0, 53 | TRANSACTION_READ_COMMITTED, 54 | TRANSACTION_READ_UNCOMMITTED, 55 | TRANSACTION_REPEATABLE_READ, 56 | TRANSACTION_SERIALIZABLE 57 | } enum_transaction_isolation; 58 | 59 | class Savepoint 60 | { 61 | /* Prevent use of these */ 62 | Savepoint(const Savepoint &); 63 | void operator=(Savepoint &); 64 | public: 65 | Savepoint() {}; 66 | virtual ~Savepoint() {}; 67 | virtual int getSavepointId() = 0; 68 | 69 | virtual sql::SQLString getSavepointName() = 0; 70 | }; 71 | 72 | 73 | class CPPCONN_PUBLIC_FUNC Connection 74 | { 75 | /* Prevent use of these */ 76 | Connection(const Connection &); 77 | void operator=(Connection &); 78 | public: 79 | 80 | Connection() {}; 81 | 82 | virtual ~Connection() {}; 83 | 84 | virtual void clearWarnings() = 0; 85 | 86 | virtual Statement *createStatement() = 0; 87 | 88 | virtual void close() = 0; 89 | 90 | virtual void commit() = 0; 91 | 92 | virtual bool getAutoCommit() = 0; 93 | 94 | virtual sql::SQLString getCatalog() = 0; 95 | 96 | virtual Driver *getDriver() = 0; 97 | 98 | virtual sql::SQLString getSchema() = 0; 99 | 100 | virtual sql::SQLString getClientInfo() = 0; 101 | 102 | virtual void getClientOption(const sql::SQLString & optionName, void * optionValue) = 0; 103 | 104 | virtual sql::SQLString getClientOption(const sql::SQLString & optionName) = 0; 105 | 106 | virtual DatabaseMetaData * getMetaData() = 0; 107 | 108 | virtual enum_transaction_isolation getTransactionIsolation() = 0; 109 | 110 | virtual const SQLWarning * getWarnings() = 0; 111 | 112 | virtual bool isClosed() = 0; 113 | 114 | virtual bool isReadOnly() = 0; 115 | 116 | virtual bool isValid() = 0; 117 | 118 | virtual bool reconnect() = 0; 119 | 120 | virtual sql::SQLString nativeSQL(const sql::SQLString& sql) = 0; 121 | 122 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql) = 0; 123 | 124 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql, int autoGeneratedKeys) = 0; 125 | 126 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql, int* columnIndexes) = 0; 127 | 128 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql, int resultSetType, int resultSetConcurrency) = 0; 129 | 130 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) = 0; 131 | 132 | virtual PreparedStatement * prepareStatement(const sql::SQLString& sql, sql::SQLString columnNames[]) = 0; 133 | 134 | virtual void releaseSavepoint(Savepoint * savepoint) = 0; 135 | 136 | virtual void rollback() = 0; 137 | 138 | virtual void rollback(Savepoint * savepoint) = 0; 139 | 140 | virtual void setAutoCommit(bool autoCommit) = 0; 141 | 142 | virtual void setCatalog(const sql::SQLString& catalog) = 0; 143 | 144 | virtual void setSchema(const sql::SQLString& catalog) = 0; 145 | 146 | virtual sql::Connection * setClientOption(const sql::SQLString & optionName, const void * optionValue) = 0; 147 | 148 | virtual sql::Connection * setClientOption(const sql::SQLString & optionName, const sql::SQLString & optionValue) = 0; 149 | 150 | virtual void setHoldability(int holdability) = 0; 151 | 152 | virtual void setReadOnly(bool readOnly) = 0; 153 | 154 | virtual Savepoint * setSavepoint() = 0; 155 | 156 | virtual Savepoint * setSavepoint(const sql::SQLString& name) = 0; 157 | 158 | virtual void setTransactionIsolation(enum_transaction_isolation level) = 0; 159 | 160 | /* virtual void setTypeMap(Map map) = 0; */ 161 | }; 162 | 163 | } /* namespace sql */ 164 | 165 | #endif // _SQL_CONNECTION_H_ 166 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/mysql/cppconn/exception.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_EXCEPTION_H_ 28 | #define _SQL_EXCEPTION_H_ 29 | 30 | #include "build_config.h" 31 | #include 32 | #include 33 | #include 34 | 35 | namespace sql 36 | { 37 | 38 | #define MEMORY_ALLOC_OPERATORS(Class) \ 39 | void* operator new(size_t size) throw (std::bad_alloc) { return ::operator new(size); } \ 40 | void* operator new(size_t, void*) throw(); \ 41 | void* operator new(size_t, const std::nothrow_t&) throw(); \ 42 | void* operator new[](size_t) throw (std::bad_alloc); \ 43 | void* operator new[](size_t, void*) throw(); \ 44 | void* operator new[](size_t, const std::nothrow_t&) throw(); \ 45 | void* operator new(size_t N, std::allocator&); 46 | 47 | #ifdef _WIN32 48 | #pragma warning (disable : 4290) 49 | //warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) 50 | 51 | 52 | #pragma warning(push) 53 | #pragma warning(disable: 4275) 54 | #endif 55 | class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error 56 | { 57 | #ifdef _WIN32 58 | #pragma warning(pop) 59 | #endif 60 | protected: 61 | const std::string sql_state; 62 | const int errNo; 63 | 64 | public: 65 | SQLException(const SQLException& e) : std::runtime_error(e.what()), sql_state(e.sql_state), errNo(e.errNo) {} 66 | 67 | SQLException(const std::string& reason, const std::string& SQLState, int vendorCode) : 68 | std::runtime_error (reason ), 69 | sql_state (SQLState ), 70 | errNo (vendorCode) 71 | {} 72 | 73 | SQLException(const std::string& reason, const std::string& SQLState) : std::runtime_error(reason), sql_state(SQLState), errNo(0) {} 74 | 75 | SQLException(const std::string& reason) : std::runtime_error(reason), sql_state("HY000"), errNo(0) {} 76 | 77 | SQLException() : std::runtime_error(""), sql_state("HY000"), errNo(0) {} 78 | 79 | const std::string & getSQLState() const 80 | { 81 | return sql_state; 82 | } 83 | 84 | const char * getSQLStateCStr() const 85 | { 86 | return sql_state.c_str(); 87 | } 88 | 89 | 90 | int getErrorCode() const 91 | { 92 | return errNo; 93 | } 94 | 95 | virtual ~SQLException() throw () {}; 96 | 97 | protected: 98 | MEMORY_ALLOC_OPERATORS(SQLException) 99 | }; 100 | 101 | struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException 102 | { 103 | MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } 104 | MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {} 105 | }; 106 | 107 | struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException 108 | { 109 | InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } 110 | InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {} 111 | }; 112 | 113 | struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException 114 | { 115 | InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } 116 | InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {} 117 | }; 118 | 119 | 120 | struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException 121 | { 122 | NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } 123 | NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {} 124 | }; 125 | 126 | struct CPPCONN_PUBLIC_FUNC SQLUnsupportedOptionException : public SQLException 127 | { 128 | SQLUnsupportedOptionException(const SQLUnsupportedOptionException& e, const std::string conn_option) : 129 | SQLException(e.what(), e.sql_state, e.errNo), 130 | option(conn_option ) 131 | {} 132 | 133 | SQLUnsupportedOptionException(const std::string& reason, const std::string conn_option) : 134 | SQLException(reason, "", 0), 135 | option(conn_option ) 136 | {} 137 | 138 | const char *getConnectionOption() const 139 | { 140 | return option.c_str(); 141 | } 142 | 143 | ~SQLUnsupportedOptionException() throw () {}; 144 | protected: 145 | const std::string option; 146 | }; 147 | 148 | } /* namespace sql */ 149 | 150 | #endif /* _SQL_EXCEPTION_H_ */ 151 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/mysql/cppconn/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_METADATA_H_ 28 | #define _SQL_METADATA_H_ 29 | 30 | #include 31 | #include 32 | #include "datatype.h" 33 | #include "sqlstring.h" 34 | 35 | namespace sql 36 | { 37 | class ResultSet; 38 | 39 | class DatabaseMetaData 40 | { 41 | protected: 42 | virtual ~DatabaseMetaData() {} 43 | 44 | public: 45 | enum 46 | { 47 | attributeNoNulls = 0, 48 | attributeNullable, 49 | attributeNullableUnknown 50 | }; 51 | enum 52 | { 53 | bestRowTemporary = 0, 54 | bestRowTransaction, 55 | bestRowSession 56 | }; 57 | enum 58 | { 59 | bestRowUnknown = 0, 60 | bestRowNotPseudo, 61 | bestRowPseudo 62 | }; 63 | enum 64 | { 65 | columnNoNulls = 0, 66 | columnNullable, 67 | columnNullableUnknown 68 | }; 69 | enum 70 | { 71 | importedKeyCascade = 0, 72 | importedKeyInitiallyDeferred, 73 | importedKeyInitiallyImmediate, 74 | importedKeyNoAction, 75 | importedKeyNotDeferrable, 76 | importedKeyRestrict, 77 | importedKeySetDefault, 78 | importedKeySetNull 79 | }; 80 | enum 81 | { 82 | procedureColumnIn = 0, 83 | procedureColumnInOut, 84 | procedureColumnOut, 85 | procedureColumnResult, 86 | procedureColumnReturn, 87 | procedureColumnUnknown, 88 | procedureNoNulls, 89 | procedureNoResult, 90 | procedureNullable, 91 | procedureNullableUnknown, 92 | procedureResultUnknown, 93 | procedureReturnsResult 94 | }; 95 | enum 96 | { 97 | sqlStateSQL99 = 0, 98 | sqlStateXOpen 99 | }; 100 | enum 101 | { 102 | tableIndexClustered = 0, 103 | tableIndexHashed, 104 | tableIndexOther, 105 | tableIndexStatistic 106 | }; 107 | enum 108 | { 109 | versionColumnUnknown = 0, 110 | versionColumnNotPseudo = 1, 111 | versionColumnPseudo = 2 112 | }; 113 | enum 114 | { 115 | typeNoNulls = 0, 116 | typeNullable = 1, 117 | typeNullableUnknown = 2 118 | }; 119 | enum 120 | { 121 | typePredNone = 0, 122 | typePredChar = 1, 123 | typePredBasic= 2, 124 | typeSearchable = 3 125 | }; 126 | 127 | 128 | virtual bool allProceduresAreCallable() = 0; 129 | 130 | virtual bool allTablesAreSelectable() = 0; 131 | 132 | virtual bool dataDefinitionCausesTransactionCommit() = 0; 133 | 134 | virtual bool dataDefinitionIgnoredInTransactions() = 0; 135 | 136 | virtual bool deletesAreDetected(int type) = 0; 137 | 138 | virtual bool doesMaxRowSizeIncludeBlobs() = 0; 139 | 140 | virtual ResultSet * getAttributes(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& typeNamePattern, const sql::SQLString& attributeNamePattern) = 0; 141 | 142 | virtual ResultSet * getBestRowIdentifier(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table, int scope, bool nullable) = 0; 143 | 144 | virtual ResultSet * getCatalogs() = 0; 145 | 146 | virtual const sql::SQLString& getCatalogSeparator() = 0; 147 | 148 | virtual const sql::SQLString& getCatalogTerm() = 0; 149 | 150 | virtual ResultSet * getColumnPrivileges(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table, const sql::SQLString& columnNamePattern) = 0; 151 | 152 | virtual ResultSet * getColumns(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern, const sql::SQLString& columnNamePattern) = 0; 153 | 154 | virtual Connection * getConnection() = 0; 155 | 156 | virtual ResultSet * getCrossReference(const sql::SQLString& primaryCatalog, const sql::SQLString& primarySchema, const sql::SQLString& primaryTable, const sql::SQLString& foreignCatalog, const sql::SQLString& foreignSchema, const sql::SQLString& foreignTable) = 0; 157 | 158 | virtual unsigned int getDatabaseMajorVersion() = 0; 159 | 160 | virtual unsigned int getDatabaseMinorVersion() = 0; 161 | 162 | virtual unsigned int getDatabasePatchVersion() = 0; 163 | 164 | virtual const sql::SQLString& getDatabaseProductName() = 0; 165 | 166 | virtual SQLString getDatabaseProductVersion() = 0; 167 | 168 | virtual int getDefaultTransactionIsolation() = 0; 169 | 170 | virtual unsigned int getDriverMajorVersion() = 0; 171 | 172 | virtual unsigned int getDriverMinorVersion() = 0; 173 | 174 | virtual unsigned int getDriverPatchVersion() = 0; 175 | 176 | virtual const sql::SQLString& getDriverName() = 0; 177 | 178 | virtual const sql::SQLString& getDriverVersion() = 0; 179 | 180 | virtual ResultSet * getExportedKeys(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table) = 0; 181 | 182 | virtual const sql::SQLString& getExtraNameCharacters() = 0; 183 | 184 | virtual const sql::SQLString& getIdentifierQuoteString() = 0; 185 | 186 | virtual ResultSet * getImportedKeys(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table) = 0; 187 | 188 | virtual ResultSet * getIndexInfo(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table, bool unique, bool approximate) = 0; 189 | 190 | virtual unsigned int getCDBCMajorVersion() = 0; 191 | 192 | virtual unsigned int getCDBCMinorVersion() = 0; 193 | 194 | virtual unsigned int getMaxBinaryLiteralLength() = 0; 195 | 196 | virtual unsigned int getMaxCatalogNameLength() = 0; 197 | 198 | virtual unsigned int getMaxCharLiteralLength() = 0; 199 | 200 | virtual unsigned int getMaxColumnNameLength() = 0; 201 | 202 | virtual unsigned int getMaxColumnsInGroupBy() = 0; 203 | 204 | virtual unsigned int getMaxColumnsInIndex() = 0; 205 | 206 | virtual unsigned int getMaxColumnsInOrderBy() = 0; 207 | 208 | virtual unsigned int getMaxColumnsInSelect() = 0; 209 | 210 | virtual unsigned int getMaxColumnsInTable() = 0; 211 | 212 | virtual unsigned int getMaxConnections() = 0; 213 | 214 | virtual unsigned int getMaxCursorNameLength() = 0; 215 | 216 | virtual unsigned int getMaxIndexLength() = 0; 217 | 218 | virtual unsigned int getMaxProcedureNameLength() = 0; 219 | 220 | virtual unsigned int getMaxRowSize() = 0; 221 | 222 | virtual unsigned int getMaxSchemaNameLength() = 0; 223 | 224 | virtual unsigned int getMaxStatementLength() = 0; 225 | 226 | virtual unsigned int getMaxStatements() = 0; 227 | 228 | virtual unsigned int getMaxTableNameLength() = 0; 229 | 230 | virtual unsigned int getMaxTablesInSelect() = 0; 231 | 232 | virtual unsigned int getMaxUserNameLength() = 0; 233 | 234 | virtual const sql::SQLString& getNumericFunctions() = 0; 235 | 236 | virtual ResultSet * getPrimaryKeys(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table) = 0; 237 | 238 | virtual ResultSet * getProcedureColumns(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& procedureNamePattern, const sql::SQLString& columnNamePattern) = 0; 239 | 240 | virtual ResultSet * getProcedures(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& procedureNamePattern) = 0; 241 | 242 | virtual const sql::SQLString& getProcedureTerm() = 0; 243 | 244 | virtual int getResultSetHoldability() = 0; 245 | 246 | virtual ResultSet * getSchemas() = 0; 247 | 248 | virtual const sql::SQLString& getSchemaTerm() = 0; 249 | 250 | virtual ResultSet * getSchemaCollation(const sql::SQLString& catalog, const sql::SQLString& schemaPattern) = 0; 251 | 252 | virtual ResultSet * getSchemaCharset(const sql::SQLString& catalog, const sql::SQLString& schemaPattern) = 0; 253 | 254 | virtual const sql::SQLString& getSearchStringEscape() = 0; 255 | 256 | virtual const sql::SQLString& getSQLKeywords() = 0; 257 | 258 | virtual int getSQLStateType() = 0; 259 | 260 | virtual const sql::SQLString& getStringFunctions() = 0; 261 | 262 | virtual ResultSet * getSuperTables(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern) = 0; 263 | 264 | virtual ResultSet * getSuperTypes(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& typeNamePattern) = 0; 265 | 266 | virtual const sql::SQLString& getSystemFunctions() = 0; 267 | 268 | virtual ResultSet * getTablePrivileges(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern) = 0; 269 | 270 | virtual ResultSet * getTables(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern, std::list &types) = 0; 271 | 272 | virtual ResultSet * getTableTypes() = 0; 273 | 274 | virtual ResultSet * getTableCollation(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern) = 0; 275 | 276 | virtual ResultSet * getTableCharset(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& tableNamePattern) = 0; 277 | 278 | virtual const sql::SQLString& getTimeDateFunctions() = 0; 279 | 280 | virtual ResultSet * getTypeInfo() = 0; 281 | 282 | virtual ResultSet * getUDTs(const sql::SQLString& catalog, const sql::SQLString& schemaPattern, const sql::SQLString& typeNamePattern, std::list &types) = 0; 283 | 284 | virtual SQLString getURL() = 0; 285 | 286 | virtual SQLString getUserName() = 0; 287 | 288 | virtual ResultSet * getVersionColumns(const sql::SQLString& catalog, const sql::SQLString& schema, const sql::SQLString& table) = 0; 289 | 290 | virtual bool insertsAreDetected(int type) = 0; 291 | 292 | virtual bool isCatalogAtStart() = 0; 293 | 294 | virtual bool isReadOnly() = 0; 295 | 296 | virtual bool locatorsUpdateCopy() = 0; 297 | 298 | virtual bool nullPlusNonNullIsNull() = 0; 299 | 300 | virtual bool nullsAreSortedAtEnd() = 0; 301 | 302 | virtual bool nullsAreSortedAtStart() = 0; 303 | 304 | virtual bool nullsAreSortedHigh() = 0; 305 | 306 | virtual bool nullsAreSortedLow() = 0; 307 | 308 | virtual bool othersDeletesAreVisible(int type) = 0; 309 | 310 | virtual bool othersInsertsAreVisible(int type) = 0; 311 | 312 | virtual bool othersUpdatesAreVisible(int type) = 0; 313 | 314 | virtual bool ownDeletesAreVisible(int type) = 0; 315 | 316 | virtual bool ownInsertsAreVisible(int type) = 0; 317 | 318 | virtual bool ownUpdatesAreVisible(int type) = 0; 319 | 320 | virtual bool storesLowerCaseIdentifiers() = 0; 321 | 322 | virtual bool storesLowerCaseQuotedIdentifiers() = 0; 323 | 324 | virtual bool storesMixedCaseIdentifiers() = 0; 325 | 326 | virtual bool storesMixedCaseQuotedIdentifiers() = 0; 327 | 328 | virtual bool storesUpperCaseIdentifiers() = 0; 329 | 330 | virtual bool storesUpperCaseQuotedIdentifiers() = 0; 331 | 332 | virtual bool supportsAlterTableWithAddColumn() = 0; 333 | 334 | virtual bool supportsAlterTableWithDropColumn() = 0; 335 | 336 | virtual bool supportsANSI92EntryLevelSQL() = 0; 337 | 338 | virtual bool supportsANSI92FullSQL() = 0; 339 | 340 | virtual bool supportsANSI92IntermediateSQL() = 0; 341 | 342 | virtual bool supportsBatchUpdates() = 0; 343 | 344 | virtual bool supportsCatalogsInDataManipulation() = 0; 345 | 346 | virtual bool supportsCatalogsInIndexDefinitions() = 0; 347 | 348 | virtual bool supportsCatalogsInPrivilegeDefinitions() = 0; 349 | 350 | virtual bool supportsCatalogsInProcedureCalls() = 0; 351 | 352 | virtual bool supportsCatalogsInTableDefinitions() = 0; 353 | 354 | virtual bool supportsColumnAliasing() = 0; 355 | 356 | virtual bool supportsConvert() = 0; 357 | 358 | virtual bool supportsConvert(int fromType, int toType) = 0; 359 | 360 | virtual bool supportsCoreSQLGrammar() = 0; 361 | 362 | virtual bool supportsCorrelatedSubqueries() = 0; 363 | 364 | virtual bool supportsDataDefinitionAndDataManipulationTransactions() = 0; 365 | 366 | virtual bool supportsDataManipulationTransactionsOnly() = 0; 367 | 368 | virtual bool supportsDifferentTableCorrelationNames() = 0; 369 | 370 | virtual bool supportsExpressionsInOrderBy() = 0; 371 | 372 | virtual bool supportsExtendedSQLGrammar() = 0; 373 | 374 | virtual bool supportsFullOuterJoins() = 0; 375 | 376 | virtual bool supportsGetGeneratedKeys() = 0; 377 | 378 | virtual bool supportsGroupBy() = 0; 379 | 380 | virtual bool supportsGroupByBeyondSelect() = 0; 381 | 382 | virtual bool supportsGroupByUnrelated() = 0; 383 | 384 | virtual bool supportsIntegrityEnhancementFacility() = 0; 385 | 386 | virtual bool supportsLikeEscapeClause() = 0; 387 | 388 | virtual bool supportsLimitedOuterJoins() = 0; 389 | 390 | virtual bool supportsMinimumSQLGrammar() = 0; 391 | 392 | virtual bool supportsMixedCaseIdentifiers() = 0; 393 | 394 | virtual bool supportsMixedCaseQuotedIdentifiers() = 0; 395 | 396 | virtual bool supportsMultipleOpenResults() = 0; 397 | 398 | virtual bool supportsMultipleResultSets() = 0; 399 | 400 | virtual bool supportsMultipleTransactions() = 0; 401 | 402 | virtual bool supportsNamedParameters() = 0; 403 | 404 | virtual bool supportsNonNullableColumns() = 0; 405 | 406 | virtual bool supportsOpenCursorsAcrossCommit() = 0; 407 | 408 | virtual bool supportsOpenCursorsAcrossRollback() = 0; 409 | 410 | virtual bool supportsOpenStatementsAcrossCommit() = 0; 411 | 412 | virtual bool supportsOpenStatementsAcrossRollback() = 0; 413 | 414 | virtual bool supportsOrderByUnrelated() = 0; 415 | 416 | virtual bool supportsOuterJoins() = 0; 417 | 418 | virtual bool supportsPositionedDelete() = 0; 419 | 420 | virtual bool supportsPositionedUpdate() = 0; 421 | 422 | virtual bool supportsResultSetConcurrency(int type, int concurrency) = 0; 423 | 424 | virtual bool supportsResultSetHoldability(int holdability) = 0; 425 | 426 | virtual bool supportsResultSetType(int type) = 0; 427 | 428 | virtual bool supportsSavepoints() = 0; 429 | 430 | virtual bool supportsSchemasInDataManipulation() = 0; 431 | 432 | virtual bool supportsSchemasInIndexDefinitions() = 0; 433 | 434 | virtual bool supportsSchemasInPrivilegeDefinitions() = 0; 435 | 436 | virtual bool supportsSchemasInProcedureCalls() = 0; 437 | 438 | virtual bool supportsSchemasInTableDefinitions() = 0; 439 | 440 | virtual bool supportsSelectForUpdate() = 0; 441 | 442 | virtual bool supportsStatementPooling() = 0; 443 | 444 | virtual bool supportsStoredProcedures() = 0; 445 | 446 | virtual bool supportsSubqueriesInComparisons() = 0; 447 | 448 | virtual bool supportsSubqueriesInExists() = 0; 449 | 450 | virtual bool supportsSubqueriesInIns() = 0; 451 | 452 | virtual bool supportsSubqueriesInQuantifieds() = 0; 453 | 454 | virtual bool supportsTableCorrelationNames() = 0; 455 | 456 | virtual bool supportsTransactionIsolationLevel(int level) = 0; 457 | 458 | virtual bool supportsTransactions() = 0; 459 | 460 | virtual bool supportsTypeConversion() = 0; /* SDBC */ 461 | 462 | virtual bool supportsUnion() = 0; 463 | 464 | virtual bool supportsUnionAll() = 0; 465 | 466 | virtual bool updatesAreDetected(int type) = 0; 467 | 468 | virtual bool usesLocalFilePerTable() = 0; 469 | 470 | virtual bool usesLocalFiles() = 0; 471 | 472 | virtual ResultSet *getSchemata(const sql::SQLString& catalogName = "") = 0; 473 | 474 | virtual ResultSet *getSchemaObjects(const sql::SQLString& catalogName = "", 475 | const sql::SQLString& schemaName = "", 476 | const sql::SQLString& objectType = "", 477 | bool includingDdl = true, 478 | const sql::SQLString& objectName = "", 479 | const sql::SQLString& contextTableName = "") = 0; 480 | 481 | virtual ResultSet *getSchemaObjectTypes() = 0; 482 | }; 483 | 484 | 485 | } /* namespace sql */ 486 | 487 | #endif /* _SQL_METADATA_H_ */ 488 | -------------------------------------------------------------------------------- /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/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.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 34 | #include 35 | #include "sqlstring.h" 36 | #include "resultset_metadata.h" 37 | 38 | 39 | namespace sql 40 | { 41 | 42 | class Statement; 43 | 44 | class RowID 45 | { 46 | public: 47 | virtual ~RowID() {} 48 | }; 49 | 50 | class ResultSet 51 | { 52 | public: 53 | enum 54 | { 55 | CLOSE_CURSORS_AT_COMMIT, 56 | HOLD_CURSORS_OVER_COMMIT 57 | }; 58 | enum 59 | { 60 | CONCUR_READ_ONLY, 61 | CONCUR_UPDATABLE 62 | }; 63 | enum 64 | { 65 | FETCH_FORWARD, 66 | FETCH_REVERSE, 67 | FETCH_UNKNOWN 68 | }; 69 | typedef enum 70 | { 71 | TYPE_FORWARD_ONLY, 72 | TYPE_SCROLL_INSENSITIVE, 73 | TYPE_SCROLL_SENSITIVE 74 | } enum_type; 75 | 76 | virtual ~ResultSet() {} 77 | 78 | virtual bool absolute(int row) = 0; 79 | 80 | virtual void afterLast() = 0; 81 | 82 | virtual void beforeFirst() = 0; 83 | 84 | virtual void cancelRowUpdates() = 0; 85 | 86 | virtual void clearWarnings() = 0; 87 | 88 | virtual void close() = 0; 89 | 90 | virtual uint32_t findColumn(const sql::SQLString& columnLabel) const = 0; 91 | 92 | virtual bool first() = 0; 93 | 94 | virtual std::istream * getBlob(uint32_t columnIndex) const = 0; 95 | virtual std::istream * getBlob(const sql::SQLString& columnLabel) const = 0; 96 | 97 | virtual bool getBoolean(uint32_t columnIndex) const = 0; 98 | virtual bool getBoolean(const sql::SQLString& columnLabel) const = 0; 99 | 100 | virtual int getConcurrency() = 0; 101 | virtual SQLString getCursorName() = 0; 102 | 103 | virtual long double getDouble(uint32_t columnIndex) const = 0; 104 | virtual long double getDouble(const sql::SQLString& columnLabel) const = 0; 105 | 106 | virtual int getFetchDirection() = 0; 107 | virtual size_t getFetchSize() = 0; 108 | virtual int getHoldability() = 0; 109 | 110 | virtual int32_t getInt(uint32_t columnIndex) const = 0; 111 | virtual int32_t getInt(const sql::SQLString& columnLabel) const = 0; 112 | 113 | virtual uint32_t getUInt(uint32_t columnIndex) const = 0; 114 | virtual uint32_t getUInt(const sql::SQLString& columnLabel) const = 0; 115 | 116 | virtual int64_t getInt64(uint32_t columnIndex) const = 0; 117 | virtual int64_t getInt64(const sql::SQLString& columnLabel) const = 0; 118 | 119 | virtual uint64_t getUInt64(uint32_t columnIndex) const = 0; 120 | virtual uint64_t getUInt64(const sql::SQLString& columnLabel) const = 0; 121 | 122 | virtual ResultSetMetaData * getMetaData() const = 0; 123 | 124 | virtual size_t getRow() const = 0; 125 | 126 | virtual RowID * getRowId(uint32_t columnIndex) = 0; 127 | virtual RowID * getRowId(const sql::SQLString & columnLabel) = 0; 128 | 129 | virtual const Statement * getStatement() const = 0; 130 | 131 | virtual SQLString getString(uint32_t columnIndex) const = 0; 132 | virtual SQLString getString(const sql::SQLString& columnLabel) const = 0; 133 | 134 | virtual enum_type getType() const = 0; 135 | 136 | virtual void getWarnings() = 0; 137 | 138 | virtual void insertRow() = 0; 139 | 140 | virtual bool isAfterLast() const = 0; 141 | 142 | virtual bool isBeforeFirst() const = 0; 143 | 144 | virtual bool isClosed() const = 0; 145 | 146 | virtual bool isFirst() const = 0; 147 | 148 | virtual bool isLast() const = 0; 149 | 150 | virtual bool isNull(uint32_t columnIndex) const = 0; 151 | virtual bool isNull(const sql::SQLString& columnLabel) const = 0; 152 | 153 | virtual bool last() = 0; 154 | 155 | virtual bool next() = 0; 156 | 157 | virtual void moveToCurrentRow() = 0; 158 | 159 | virtual void moveToInsertRow() = 0; 160 | 161 | virtual bool previous() = 0; 162 | 163 | virtual void refreshRow() = 0; 164 | 165 | virtual bool relative(int rows) = 0; 166 | 167 | virtual bool rowDeleted() = 0; 168 | 169 | virtual bool rowInserted() = 0; 170 | 171 | virtual bool rowUpdated() = 0; 172 | 173 | virtual void setFetchSize(size_t rows) = 0; 174 | 175 | virtual size_t rowsCount() const = 0; 176 | 177 | virtual bool wasNull() const = 0; 178 | }; 179 | 180 | } /* namespace sql */ 181 | 182 | #endif /* _SQL_RESULTSET_H_ */ 183 | -------------------------------------------------------------------------------- /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/cppconn/sqlstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, 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_STRING_H_ 28 | #define _SQL_STRING_H_ 29 | 30 | #include 31 | #include 32 | #include "build_config.h" 33 | #include 34 | 35 | namespace sql 36 | { 37 | class CPPCONN_PUBLIC_FUNC SQLString 38 | { 39 | std::string realStr; 40 | 41 | public: 42 | #ifdef _WIN32 43 | //TODO something less dirty-hackish. 44 | static const size_t npos = static_cast(-1); 45 | #else 46 | static const size_t npos = std::string::npos; 47 | #endif 48 | 49 | ~SQLString() {} 50 | 51 | SQLString() {} 52 | 53 | SQLString(const SQLString & other) : realStr(other.realStr) {} 54 | 55 | SQLString(const std::string & other) : realStr(other) {} 56 | 57 | SQLString(const char other[]) : realStr(other) {} 58 | 59 | SQLString(const char * s, size_t n) : realStr(s, n) {} 60 | 61 | // Needed for stuff like SQLString str= "char * string constant" 62 | const SQLString & operator=(const char * s) 63 | { 64 | realStr = s; 65 | return *this; 66 | } 67 | 68 | const SQLString & operator=(const std::string & rhs) 69 | { 70 | realStr = rhs; 71 | return *this; 72 | } 73 | 74 | const SQLString & operator=(const SQLString & rhs) 75 | { 76 | realStr = rhs.realStr; 77 | return *this; 78 | } 79 | 80 | // Conversion to st::string. Comes in play for stuff like std::string str= SQLString_var; 81 | operator const std::string &() const 82 | { 83 | return realStr; 84 | } 85 | 86 | /** For access std::string methods. Not sure we need it. Makes it look like some smart ptr. 87 | possibly operator* - will look even more like smart ptr */ 88 | std::string * operator ->() 89 | { 90 | return & realStr; 91 | } 92 | 93 | int compare(const SQLString& str) const 94 | { 95 | return realStr.compare(str.realStr); 96 | } 97 | 98 | int compare(const char * s) const 99 | { 100 | return realStr.compare(s); 101 | } 102 | 103 | int compare(size_t pos1, size_t n1, const char * s) const 104 | { 105 | return realStr.compare(pos1, n1, s); 106 | } 107 | 108 | int caseCompare(const SQLString &s) const 109 | { 110 | std::string tmp(realStr), str(s); 111 | std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower); 112 | std::transform(str.begin(), str.end(), str.begin(), ::tolower); 113 | return tmp.compare(str); 114 | } 115 | 116 | int caseCompare(const char * s) const 117 | { 118 | std::string tmp(realStr), str(s); 119 | std::transform(str.begin(), str.end(), str.begin(), ::tolower); 120 | std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower); 121 | return tmp.compare(str); 122 | } 123 | 124 | int caseCompare(size_t pos1, size_t n1, const char * s) const 125 | { 126 | std::string tmp(realStr.c_str() + pos1, n1), str(s); 127 | std::transform(str.begin(), str.end(), str.begin(), ::tolower); 128 | std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower); 129 | return tmp.compare(str); 130 | } 131 | 132 | const std::string & asStdString() const 133 | { 134 | return realStr; 135 | } 136 | 137 | const char * c_str() const 138 | { 139 | return realStr.c_str(); 140 | } 141 | 142 | size_t length() const 143 | { 144 | return realStr.length(); 145 | } 146 | 147 | SQLString & append(const std::string & str) 148 | { 149 | realStr.append(str); 150 | return *this; 151 | } 152 | 153 | SQLString & append(const char * s) 154 | { 155 | realStr.append(s); 156 | return *this; 157 | } 158 | 159 | const char& operator[](size_t pos) const 160 | { 161 | return realStr[pos]; 162 | } 163 | 164 | size_t find(char c, size_t pos = 0) const 165 | { 166 | return realStr.find(c, pos); 167 | } 168 | 169 | size_t find(const SQLString & s, size_t pos = 0) const 170 | { 171 | return realStr.find(s.realStr, pos); 172 | } 173 | 174 | SQLString substr(size_t pos = 0, size_t n = npos) const 175 | { 176 | return realStr.substr(pos, n); 177 | } 178 | 179 | const SQLString& replace(size_t pos1, size_t n1, const SQLString & s) 180 | { 181 | realStr.replace(pos1, n1, s.realStr); 182 | return *this; 183 | } 184 | 185 | size_t find_first_of(char c, size_t pos = 0) const 186 | { 187 | return realStr.find_first_of(c, pos); 188 | } 189 | 190 | size_t find_last_of(char c, size_t pos = npos) const 191 | { 192 | return realStr.find_last_of(c, pos); 193 | } 194 | 195 | const SQLString & operator+=(const SQLString & op2) 196 | { 197 | realStr += op2.realStr; 198 | return *this; 199 | } 200 | }; 201 | 202 | 203 | /* 204 | Operators that can and have to be not a member. 205 | */ 206 | inline const SQLString operator+(const SQLString & op1, const SQLString & op2) 207 | { 208 | return sql::SQLString(op1.asStdString() + op2.asStdString()); 209 | } 210 | 211 | inline bool operator ==(const SQLString & op1, const SQLString & op2) 212 | { 213 | return (op1.asStdString() == op2.asStdString()); 214 | } 215 | 216 | inline bool operator !=(const SQLString & op1, const SQLString & op2) 217 | { 218 | return (op1.asStdString() != op2.asStdString()); 219 | } 220 | 221 | inline bool operator <(const SQLString & op1, const SQLString & op2) 222 | { 223 | return op1.asStdString() < op2.asStdString(); 224 | } 225 | 226 | 227 | }// namespace sql 228 | 229 | 230 | namespace std 231 | { 232 | // operator << for SQLString output 233 | inline ostream & operator << (ostream & os, const sql::SQLString & str ) 234 | { 235 | return os << str.asStdString(); 236 | } 237 | } 238 | #endif 239 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/mysql/cppconn/variant.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 | 26 | 27 | #ifndef _SQL_VARIANT_H_ 28 | #define _SQL_VARIANT_H_ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "build_config.h" 37 | #include "sqlstring.h" 38 | #include "exception.h" 39 | 40 | namespace sql 41 | { 42 | 43 | class BaseVariantImpl 44 | { 45 | public: 46 | BaseVariantImpl (void *ptr, sql::SQLString vtype) : 47 | cvptr(ptr), 48 | vTypeName(vtype) 49 | {} 50 | 51 | virtual ~BaseVariantImpl() { 52 | cvptr=NULL; 53 | } 54 | 55 | virtual BaseVariantImpl* Clone()=0; 56 | 57 | template 58 | T* get() const { 59 | if (typeid(T).name() == typeid(void).name()) { 60 | return static_cast< T * > (cvptr); 61 | } 62 | 63 | if ((vTypeName == typeid(std::string).name() && 64 | typeid(T).name() == typeid(sql::SQLString).name()) || 65 | (vTypeName == typeid(sql::SQLString).name() && 66 | typeid(T).name() == typeid(std::string).name()) || 67 | (vTypeName == typeid(std::map< std::string, std::string >).name() && 68 | typeid(T).name() == 69 | typeid(std::map< sql::SQLString, sql::SQLString >).name()) || 70 | (vTypeName == 71 | typeid(std::map< sql::SQLString, sql::SQLString >).name() && 72 | typeid(T).name() == 73 | typeid(std::map< std::string, std::string >).name()) || 74 | (vTypeName == typeid(std::list< std::string >).name() && 75 | typeid(T).name() == 76 | typeid(std::list< sql::SQLString >).name()) || 77 | (vTypeName == 78 | typeid(std::list< sql::SQLString >).name() && 79 | typeid(T).name() == 80 | typeid(std::list< std::string >).name())) 81 | { 82 | return static_cast< T * > (cvptr); 83 | } 84 | 85 | if (typeid(T).name() != vTypeName) { 86 | throw sql::InvalidArgumentException("Variant type doesn't match."); 87 | } 88 | 89 | return static_cast< T * > (cvptr); 90 | } 91 | 92 | protected: 93 | void *cvptr; 94 | sql::SQLString vTypeName; 95 | }; 96 | 97 | 98 | template 99 | class VariantImpl : public BaseVariantImpl 100 | { 101 | public: 102 | VariantImpl(T i) : BaseVariantImpl(new T(i), typeid(i).name()) {} 103 | 104 | ~VariantImpl() { 105 | destroy_content(); 106 | } 107 | 108 | VariantImpl(VariantImpl& that) : BaseVariantImpl(that) { 109 | copy_content(that); 110 | } 111 | 112 | VariantImpl& operator=(VariantImpl& that) { 113 | if (this != &that) { 114 | destroy_content(); 115 | if (cvptr == NULL) { 116 | copy_content(that); 117 | } 118 | } 119 | return *this; 120 | } 121 | 122 | virtual VariantImpl* Clone() { 123 | return new VariantImpl(*this); 124 | } 125 | 126 | private: 127 | 128 | void destroy_content() { 129 | T *tmp=static_cast< T * >(cvptr); 130 | if (tmp) { 131 | delete tmp; 132 | cvptr=NULL; 133 | } 134 | } 135 | 136 | void copy_content(BaseVariantImpl& that) { 137 | cvptr=new T (*(static_cast< T * > (that.get< void >()))); 138 | } 139 | }; 140 | 141 | 142 | template 143 | class VariantMap : public BaseVariantImpl 144 | { 145 | public: 146 | VariantMap(T i) : BaseVariantImpl(new T(i), typeid(i).name()) {} 147 | 148 | ~VariantMap() { 149 | destroy_content(); 150 | } 151 | 152 | VariantMap(VariantMap& that) : BaseVariantImpl(that) { 153 | if (this != &that) { 154 | copy_content(that); 155 | } 156 | } 157 | 158 | VariantMap& operator=(VariantMap& that) { 159 | if (this != &that) { 160 | destroy_content(); 161 | copy_content(that); 162 | } 163 | return *this; 164 | } 165 | 166 | virtual VariantMap* Clone() { 167 | return new VariantMap(*this); 168 | } 169 | 170 | 171 | private: 172 | void destroy_content() { 173 | T *tmp=static_cast< T *> (cvptr); 174 | if (tmp) { 175 | tmp->clear(); 176 | delete tmp; 177 | cvptr=NULL; 178 | } 179 | } 180 | 181 | void copy_content(VariantMap& var) { 182 | T *tmp=static_cast< T *> (var.cvptr); 183 | if (tmp) { 184 | cvptr=new T(); 185 | typename T::const_iterator cit=tmp->begin(); 186 | while(cit != tmp->end()) { 187 | (static_cast< T * >(cvptr))->insert( 188 | std::make_pair(sql::SQLString(cit->first), 189 | sql::SQLString(cit->second))); 190 | ++cit; 191 | } 192 | } 193 | } 194 | }; 195 | 196 | 197 | template 198 | class VariantList : public BaseVariantImpl 199 | { 200 | public: 201 | VariantList(T i) : BaseVariantImpl(new T(i), typeid(i).name()) {} 202 | 203 | ~VariantList() { 204 | destroy_content(); 205 | } 206 | 207 | VariantList(VariantList& that) : BaseVariantImpl(that) { 208 | if (this != &that) { 209 | copy_content(that); 210 | } 211 | } 212 | 213 | VariantList& operator=(VariantList& that) { 214 | if (this != &that) { 215 | destroy_content(); 216 | copy_content(that); 217 | } 218 | return *this; 219 | } 220 | 221 | virtual VariantList* Clone() { 222 | return new VariantList(*this); 223 | } 224 | 225 | 226 | private: 227 | void destroy_content() 228 | { 229 | T *tmp=static_cast< T *> (cvptr); 230 | if (tmp) { 231 | tmp->clear(); 232 | delete tmp; 233 | cvptr=NULL; 234 | } 235 | } 236 | 237 | void copy_content(VariantList& var) 238 | { 239 | T *tmp=static_cast< T *> (var.cvptr); 240 | if (tmp) { 241 | cvptr=new T(); 242 | typename T::const_iterator cit=tmp->begin(); 243 | while(cit != tmp->end()) { 244 | (static_cast< T * >(cvptr))->push_back(sql::SQLString(*cit)); 245 | ++cit; 246 | } 247 | } 248 | } 249 | }; 250 | 251 | 252 | class CPPCONN_PUBLIC_FUNC Variant 253 | { 254 | public: 255 | Variant(const int &i=0) : 256 | variant(new VariantImpl< int >(i)) {} 257 | 258 | Variant(const double &i) : 259 | variant(new VariantImpl< double >(i)) {} 260 | 261 | Variant(const bool &i) : 262 | variant(new VariantImpl< bool >(i)) {} 263 | 264 | Variant(const std::string &i) : 265 | variant(new VariantImpl< std::string >(i)) {} 266 | 267 | Variant(const sql::SQLString &i) : 268 | variant(new VariantImpl< sql::SQLString >(i)) {} 269 | 270 | Variant(const std::list< std::string > &i) : 271 | variant(new VariantList< std::list < std::string > >(i)) {} 272 | 273 | Variant(const std::list< sql::SQLString > &i) : 274 | variant(new VariantList< std::list < sql::SQLString > >(i)) {} 275 | 276 | Variant(const std::map< std::string, std::string > &i) : 277 | variant(new VariantMap< std::map< std::string, std::string > >(i)) {} 278 | 279 | Variant(const std::map< sql::SQLString, sql::SQLString > &i) : 280 | variant(new VariantMap< std::map< sql::SQLString, sql::SQLString > >(i)) {} 281 | 282 | ~Variant() { 283 | if (variant) { 284 | delete variant; 285 | variant=0; 286 | } 287 | } 288 | 289 | Variant(const Variant& that) { 290 | if (this != &that) { 291 | variant=that.variant->Clone(); 292 | } 293 | } 294 | 295 | Variant& operator=(const Variant& that) { 296 | if (this != &that) { 297 | delete variant; 298 | variant=that.variant->Clone(); 299 | } 300 | return *this; 301 | } 302 | 303 | template 304 | T* get() const { 305 | return variant->get(); 306 | } 307 | 308 | private: 309 | BaseVariantImpl *variant; 310 | }; 311 | 312 | 313 | } /* namespace sql */ 314 | 315 | #endif /* _SQL_VARIANT_H_ */ 316 | -------------------------------------------------------------------------------- /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/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/mysql_connection.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 _MYSQL_CONNECTION_H_ 28 | #define _MYSQL_CONNECTION_H_ 29 | 30 | #include "mysql/cppconn/connection.h" 31 | #include 32 | #include 33 | 34 | namespace sql 35 | { 36 | namespace mysql 37 | { 38 | 39 | class MySQL_Savepoint : public sql::Savepoint 40 | { 41 | sql::SQLString name; 42 | 43 | public: 44 | MySQL_Savepoint(const sql::SQLString &savepoint); 45 | virtual ~MySQL_Savepoint() {} 46 | 47 | int getSavepointId(); 48 | 49 | sql::SQLString getSavepointName(); 50 | 51 | private: 52 | /* Prevent use of these */ 53 | MySQL_Savepoint(const MySQL_Savepoint &); 54 | void operator=(MySQL_Savepoint &); 55 | }; 56 | 57 | 58 | class MySQL_DebugLogger; 59 | struct MySQL_ConnectionData; /* PIMPL */ 60 | class MySQL_Statement; 61 | 62 | namespace NativeAPI 63 | { 64 | class NativeConnectionWrapper; 65 | } 66 | 67 | class CPPCONN_PUBLIC_FUNC MySQL_Connection : public sql::Connection 68 | { 69 | MySQL_Statement * createServiceStmt(); 70 | 71 | public: 72 | MySQL_Connection(Driver * _driver, 73 | ::sql::mysql::NativeAPI::NativeConnectionWrapper & _proxy, 74 | const sql::SQLString& hostName, 75 | const sql::SQLString& userName, 76 | const sql::SQLString& password); 77 | 78 | MySQL_Connection(Driver * _driver, ::sql::mysql::NativeAPI::NativeConnectionWrapper & _proxy, 79 | std::map< sql::SQLString, sql::ConnectPropertyVal > & options); 80 | 81 | virtual ~MySQL_Connection(); 82 | 83 | void clearWarnings(); 84 | 85 | void close(); 86 | 87 | void commit(); 88 | 89 | sql::Statement * createStatement(); 90 | 91 | sql::SQLString escapeString(const sql::SQLString &); 92 | 93 | bool getAutoCommit(); 94 | 95 | sql::SQLString getCatalog(); 96 | 97 | Driver *getDriver(); 98 | 99 | sql::SQLString getSchema(); 100 | 101 | sql::SQLString getClientInfo(); 102 | 103 | void getClientOption(const sql::SQLString & optionName, void * optionValue); 104 | 105 | sql::SQLString getClientOption(const sql::SQLString & optionName); 106 | 107 | sql::DatabaseMetaData * getMetaData(); 108 | 109 | enum_transaction_isolation getTransactionIsolation(); 110 | 111 | const SQLWarning * getWarnings(); 112 | 113 | bool isClosed(); 114 | 115 | bool isReadOnly(); 116 | 117 | bool isValid(); 118 | 119 | bool reconnect(); 120 | 121 | sql::SQLString nativeSQL(const sql::SQLString& sql); 122 | 123 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql); 124 | 125 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql, int autoGeneratedKeys); 126 | 127 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql, int columnIndexes[]); 128 | 129 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql, int resultSetType, int resultSetConcurrency); 130 | 131 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability); 132 | 133 | sql::PreparedStatement * prepareStatement(const sql::SQLString& sql, sql::SQLString columnNames[]); 134 | 135 | void releaseSavepoint(Savepoint * savepoint) ; 136 | 137 | void rollback(); 138 | 139 | void rollback(Savepoint * savepoint); 140 | 141 | void setAutoCommit(bool autoCommit); 142 | 143 | void setCatalog(const sql::SQLString& catalog); 144 | 145 | void setSchema(const sql::SQLString& catalog); 146 | 147 | sql::Connection * setClientOption(const sql::SQLString & optionName, const void * optionValue); 148 | 149 | sql::Connection * setClientOption(const sql::SQLString & optionName, const sql::SQLString & optionValue); 150 | 151 | void setHoldability(int holdability); 152 | 153 | void setReadOnly(bool readOnly); 154 | 155 | sql::Savepoint * setSavepoint(); 156 | 157 | sql::Savepoint * setSavepoint(const sql::SQLString& name); 158 | 159 | void setTransactionIsolation(enum_transaction_isolation level); 160 | 161 | virtual sql::SQLString getSessionVariable(const sql::SQLString & varname); 162 | 163 | virtual void setSessionVariable(const sql::SQLString & varname, const sql::SQLString & value); 164 | 165 | virtual void setSessionVariable(const sql::SQLString & varname, unsigned int value); 166 | 167 | virtual sql::SQLString getLastStatementInfo(); 168 | 169 | private: 170 | /* We do not really think this class has to be subclassed*/ 171 | void checkClosed(); 172 | void init(std::map< sql::SQLString, sql::ConnectPropertyVal > & properties); 173 | 174 | Driver * driver; 175 | boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy; 176 | 177 | /* statement handle to execute queries initiated by driver. Perhaps it is 178 | a good idea to move it to a separate helper class */ 179 | boost::scoped_ptr< ::sql::mysql::MySQL_Statement > service; 180 | 181 | boost::scoped_ptr< ::sql::mysql::MySQL_ConnectionData > intern; /* pimpl */ 182 | 183 | /* Prevent use of these */ 184 | MySQL_Connection(const MySQL_Connection &); 185 | void operator=(MySQL_Connection &); 186 | }; 187 | 188 | } /* namespace mysql */ 189 | } /* namespace sql */ 190 | 191 | #endif // _MYSQL_CONNECTION_H_ 192 | 193 | /* 194 | * Local variables: 195 | * tab-width: 4 196 | * c-basic-offset: 4 197 | * End: 198 | * vim600: noet sw=4 ts=4 fdm=marker 199 | * vim<600: noet sw=4 ts=4 200 | */ 201 | -------------------------------------------------------------------------------- /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/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/res/UI-RBAS.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/res/UI-RBAS.ico -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/res/UInterfaceLib.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/res/UInterfaceLib.rc2 -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UInterfaceLib/UInterfaceLib/resource.h -------------------------------------------------------------------------------- /UInterfaceLib/UInterfaceLib/sqlite/CppSQLite3U.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // CppSQLite3U is a C++ unicode wrapper around the SQLite3 embedded database library. 3 | // 4 | // Copyright (c) 2006 Tyushkov Nikolay. All Rights Reserved. http://softvoile.com 5 | // 6 | // 7 | // Based on beautiful wrapper written by Rob Groves 8 | // (https://secure.codeproject.com/database/CppSQLite.asp). 9 | // Very good wrapper, but without unicode support unfortunately. 10 | // So, I have reconstructed it for unicode. 11 | // 12 | // CppSQLite3 wrapper: 13 | // Copyright (c) 2004 Rob Groves. All Rights Reserved. rob.groves@btinternet.com 14 | // 15 | // Permission to use, copy, modify, and distribute this software and its 16 | // documentation for any purpose, without fee, and without a written 17 | // agreement, is hereby granted, provided that the above copyright notice, 18 | // this paragraph and the following two paragraphs appear in all copies, 19 | // modifications, and distributions. 20 | // 21 | // IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, 22 | // INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 23 | // PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 24 | // EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | // THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT 27 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 | // PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF 29 | // ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". THE AUTHOR HAS NO OBLIGATION 30 | // TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 31 | // 32 | // If you want to get some documentation look at 33 | // https://secure.codeproject.com/database/CppSQLite.asp 34 | // Note, not all features from CppSQLite3 were implemented in CppSQLite3U 35 | // 36 | // V1.0 11/06/2006 - Initial Public Version 37 | // 38 | // Noteses : 39 | // I have tested this wrapper only in unicode version, so I have no idea 40 | // about its work in ANSI configuration, I think it doesn't work without modification;) 41 | // 42 | // Home page : http://softvoile.com/development/CppSQLite3U/ 43 | // Please send all bug report and comment to mail2@softvoile.com 44 | // 45 | // 46 | //////////////////////////////////////////////////////////////////////////////// 47 | 48 | #if !defined(AFX_CPPSQLITE3U_H__1B1BE273_2D1E_439C_946F_3CBD1C0EFD2F__INCLUDED_) 49 | #define AFX_CPPSQLITE3U_H__1B1BE273_2D1E_439C_946F_3CBD1C0EFD2F__INCLUDED_ 50 | 51 | #if _MSC_VER > 1000 52 | #pragma once 53 | #endif // _MSC_VER > 1000 54 | // CppSQLite3U.h : header file 55 | // 56 | #include "sqlite3.h" 57 | ///////////////////////////////////////////////////////////////////////////// 58 | 59 | #define SQL_MAXSIZE 2048 60 | 61 | #define CPPSQLITE_ERROR 1000 62 | static const bool DONT_DELETE_MSG=false; 63 | 64 | 65 | CString DoubleQuotes(CString in); 66 | 67 | class CppSQLite3Query; 68 | class CppSQLite3Statement; 69 | 70 | class CppSQLite3Exception 71 | { 72 | public: 73 | 74 | CppSQLite3Exception(const int nErrCode, 75 | LPTSTR szErrMess, 76 | bool bDeleteMsg=true); 77 | 78 | CppSQLite3Exception(const CppSQLite3Exception& e); 79 | 80 | virtual ~CppSQLite3Exception(); 81 | 82 | const int errorCode() { return mnErrCode; } 83 | 84 | LPCTSTR errorMessage() { return mpszErrMess; } 85 | 86 | static LPCTSTR errorCodeAsString(int nErrCode); 87 | 88 | private: 89 | 90 | int mnErrCode; 91 | LPTSTR mpszErrMess; 92 | }; 93 | 94 | 95 | class CppSQLite3DB 96 | { 97 | // Construction 98 | public: 99 | CppSQLite3DB(); 100 | 101 | // Operations 102 | public: 103 | 104 | virtual ~CppSQLite3DB(); 105 | 106 | void open(LPCTSTR szFile); 107 | 108 | void close(); 109 | bool tableExists(LPCTSTR szTable); 110 | int execDML(LPCTSTR szSQL); 111 | 112 | CppSQLite3Query execQuery(LPCTSTR szSQL); 113 | 114 | int execScalar(LPCTSTR szSQL); 115 | CString execScalarStr(LPCTSTR szSQL); 116 | 117 | CppSQLite3Statement compileStatement(LPCTSTR szSQL); 118 | 119 | sqlite_int64 lastRowId(); 120 | 121 | void interrupt() { sqlite3_interrupt(mpDB); } 122 | 123 | void setBusyTimeout(int nMillisecs); 124 | 125 | static const char* SQLiteVersion() { return SQLITE_VERSION; } 126 | 127 | private: 128 | 129 | CppSQLite3DB(const CppSQLite3DB& db); 130 | CppSQLite3DB& operator=(const CppSQLite3DB& db); 131 | 132 | sqlite3_stmt* compile(LPCTSTR szSQL); 133 | 134 | void checkDB(); 135 | public: 136 | sqlite3* mpDB; 137 | int mnBusyTimeoutMs; 138 | }; 139 | ///////////////////////////////////////////////////////////////////////////// 140 | 141 | class CppSQLite3Statement 142 | { 143 | public: 144 | 145 | CppSQLite3Statement(); 146 | 147 | CppSQLite3Statement(const CppSQLite3Statement& rStatement); 148 | 149 | CppSQLite3Statement(sqlite3* pDB, sqlite3_stmt* pVM); 150 | 151 | virtual ~CppSQLite3Statement(); 152 | 153 | CppSQLite3Statement& operator=(const CppSQLite3Statement& rStatement); 154 | 155 | int execDML(); 156 | 157 | CppSQLite3Query execQuery(); 158 | 159 | void bind(int nParam, LPCTSTR szValue); 160 | void bind(int nParam, const int nValue); 161 | void bind(int nParam, const double dwValue); 162 | void bind(int nParam, const unsigned char* blobValue, int nLen); 163 | void bindNull(int nParam); 164 | 165 | void reset(); 166 | 167 | void finalize(); 168 | 169 | private: 170 | 171 | void checkDB(); 172 | void checkVM(); 173 | 174 | sqlite3* mpDB; 175 | sqlite3_stmt* mpVM; 176 | }; 177 | ///////////////////// CppSQLite3Query ////////////////////////////////////////////////// 178 | class CppSQLite3Query 179 | { 180 | public: 181 | 182 | CppSQLite3Query(); 183 | 184 | CppSQLite3Query(const CppSQLite3Query& rQuery); 185 | 186 | CppSQLite3Query(sqlite3* pDB, 187 | sqlite3_stmt* pVM, 188 | bool bEof, 189 | bool bOwnVM=true); 190 | 191 | CppSQLite3Query& operator=(const CppSQLite3Query& rQuery); 192 | 193 | virtual ~CppSQLite3Query(); 194 | 195 | int numFields(); 196 | 197 | int fieldIndex(LPCTSTR szField); 198 | LPCTSTR fieldName(int nCol); 199 | 200 | LPCTSTR fieldDeclType(int nCol); 201 | int fieldDataType(int nCol); 202 | 203 | LPCTSTR fieldValue(int nField); 204 | LPCTSTR fieldValue(LPCTSTR szField); 205 | 206 | int getIntField(int nField, int nNullValue=0); 207 | int getIntField(LPCTSTR szField, int nNullValue=0); 208 | 209 | double getFloatField(int nField, double fNullValue=0.0); 210 | double getFloatField(LPCTSTR szField, double fNullValue=0.0); 211 | 212 | LPCTSTR getStringField(int nField, LPCTSTR szNullValue=_T("")); 213 | LPCTSTR getStringField(LPCTSTR szField, LPCTSTR szNullValue=_T("")); 214 | 215 | const unsigned char* getBlobField(int nField, int& nLen); 216 | const unsigned char* getBlobField(LPCTSTR szField, int& nLen); 217 | 218 | bool fieldIsNull(int nField); 219 | bool fieldIsNull(LPCTSTR szField); 220 | 221 | bool eof(); 222 | void nextRow(); 223 | void finalize(); 224 | 225 | private: 226 | 227 | void checkVM(); 228 | 229 | sqlite3* mpDB; 230 | sqlite3_stmt* mpVM; 231 | bool mbEof; 232 | int mnCols; 233 | bool mbOwnVM; 234 | }; 235 | 236 | ///////////////////////////////////////////////////////////////////////////// 237 | // 238 | // TCHAR based sqlite3 function names for Unicode/MCBS builds. 239 | // 240 | #if defined(_UNICODE) || defined(UNICODE) 241 | #pragma message("Unicode Selected") 242 | #define _sqlite3_aggregate_context sqlite3_aggregate_context 243 | #define _sqlite3_aggregate_count sqlite3_aggregate_count 244 | #define _sqlite3_bind_blob sqlite3_bind_blob 245 | #define _sqlite3_bind_double sqlite3_bind_double 246 | #define _sqlite3_bind_int sqlite3_bind_int 247 | #define _sqlite3_bind_int64 sqlite3_bind_int64 248 | #define _sqlite3_bind_null sqlite3_bind_null 249 | #define _sqlite3_bind_parameter_count sqlite3_bind_parameter_count 250 | #define _sqlite3_bind_parameter_index sqlite3_bind_parameter_index 251 | #define _sqlite3_bind_parameter_name sqlite3_bind_parameter_name 252 | #define _sqlite3_bind_text sqlite3_bind_text16 253 | #define _sqlite3_bind_text16 sqlite3_bind_text16 254 | #define _sqlite3_busy_handler sqlite3_busy_handler 255 | #define _sqlite3_busy_timeout sqlite3_busy_timeout 256 | #define _sqlite3_changes sqlite3_changes 257 | #define _sqlite3_close sqlite3_close 258 | #define _sqlite3_collation_needed sqlite3_collation_needed16 259 | #define _sqlite3_collation_needed16 sqlite3_collation_needed16 260 | #define _sqlite3_column_blob sqlite3_column_blob 261 | #define _sqlite3_column_bytes sqlite3_column_bytes16 262 | #define _sqlite3_column_bytes16 sqlite3_column_bytes16 263 | #define _sqlite3_column_count sqlite3_column_count 264 | #define _sqlite3_column_decltype sqlite3_column_decltype16 265 | #define _sqlite3_column_decltype16 sqlite3_column_decltype16 266 | #define _sqlite3_column_double sqlite3_column_double 267 | #define _sqlite3_column_int sqlite3_column_int 268 | #define _sqlite3_column_int64 sqlite3_column_int64 269 | #define _sqlite3_column_name sqlite3_column_name16 270 | #define _sqlite3_column_name16 sqlite3_column_name16 271 | #define _sqlite3_column_text sqlite3_column_text16 272 | #define _sqlite3_column_text16 sqlite3_column_text16 273 | #define _sqlite3_column_type sqlite3_column_type 274 | #define _sqlite3_commit_hook sqlite3_commit_hook 275 | #define _sqlite3_complete sqlite3_complete16 276 | #define _sqlite3_complete16 sqlite3_complete16 277 | #define _sqlite3_create_collation sqlite3_create_collation16 278 | #define _sqlite3_create_collation16 sqlite3_create_collation16 279 | #define _sqlite3_create_function sqlite3_create_function16 280 | #define _sqlite3_create_function16 sqlite3_create_function16 281 | #define _sqlite3_data_count sqlite3_data_count 282 | #define _sqlite3_errcode sqlite3_errcode 283 | #define _sqlite3_errmsg sqlite3_errmsg16 284 | #define _sqlite3_errmsg16 sqlite3_errmsg16 285 | #define _sqlite3_exec sqlite3_exec 286 | #define _sqlite3_finalize sqlite3_finalize 287 | #define _sqlite3_free sqlite3_free 288 | #define _sqlite3_free_table sqlite3_free_table 289 | #define _sqlite3_get_table sqlite3_get_table 290 | #define _sqlite3_interrupt sqlite3_interrupt 291 | #define _sqlite3_last_insert_rowid sqlite3_last_insert_rowid 292 | #define _sqlite3_libversion sqlite3_libversion 293 | #define _sqlite3_mprintf sqlite3_mprintf 294 | #define _sqlite3_open sqlite3_open16 295 | #define _sqlite3_open16 sqlite3_open16 296 | #define _sqlite3_prepare sqlite3_prepare16 297 | #define _sqlite3_prepare16 sqlite3_prepare16 298 | #define _sqlite3_progress_handler sqlite3_progress_handler 299 | #define _sqlite3_reset sqlite3_reset 300 | #define _sqlite3_result_blob sqlite3_result_blob 301 | #define _sqlite3_result_double sqlite3_result_double 302 | #define _sqlite3_result_error sqlite3_result_error16 303 | #define _sqlite3_result_error16 sqlite3_result_error16 304 | #define _sqlite3_result_int sqlite3_result_int 305 | #define _sqlite3_result_int64 sqlite3_result_int64 306 | #define _sqlite3_result_null sqlite3_result_null 307 | #define _sqlite3_result_text sqlite3_result_text16 308 | #define _sqlite3_result_text16 sqlite3_result_text16 309 | #define _sqlite3_result_text16be sqlite3_result_text16be 310 | #define _sqlite3_result_text16le sqlite3_result_text16le 311 | #define _sqlite3_result_value sqlite3_result_value 312 | #define _sqlite3_set_authorizer sqlite3_set_authorizer 313 | #define _sqlite3_step sqlite3_step 314 | #define _sqlite3_total_changes sqlite3_total_changes 315 | #define _sqlite3_trace sqlite3_trace 316 | #define _sqlite3_user_data sqlite3_user_data 317 | #define _sqlite3_value_blob sqlite3_value_blob 318 | #define _sqlite3_value_bytes sqlite3_value_bytes16 319 | #define _sqlite3_value_bytes16 sqlite3_value_bytes16 320 | #define _sqlite3_value_double sqlite3_value_double 321 | #define _sqlite3_value_int sqlite3_value_int 322 | #define _sqlite3_value_int64 sqlite3_value_int64 323 | #define _sqlite3_value_text sqlite3_value_text16 324 | #define _sqlite3_value_text16 sqlite3_value_text16 325 | #define _sqlite3_value_text16be sqlite3_value_text16be 326 | #define _sqlite3_value_text16le sqlite3_value_text16le 327 | #define _sqlite3_value_type sqlite3_value_type 328 | #define _sqlite3_vmprintf sqlite3_vmprintf 329 | #else 330 | #pragma message("MCBS Selected") 331 | #define _sqlite3_aggregate_context sqlite3_aggregate_context 332 | #define _sqlite3_aggregate_count sqlite3_aggregate_count 333 | #define _sqlite3_bind_blob sqlite3_bind_blob 334 | #define _sqlite3_bind_double sqlite3_bind_double 335 | #define _sqlite3_bind_int sqlite3_bind_int 336 | #define _sqlite3_bind_int64 sqlite3_bind_int64 337 | #define _sqlite3_bind_null sqlite3_bind_null 338 | #define _sqlite3_bind_parameter_count sqlite3_bind_parameter_count 339 | #define _sqlite3_bind_parameter_index sqlite3_bind_parameter_index 340 | #define _sqlite3_bind_parameter_name sqlite3_bind_parameter_name 341 | #define _sqlite3_bind_text sqlite3_bind_text 342 | #define _sqlite3_bind_text16 sqlite3_bind_text16 343 | #define _sqlite3_busy_handler sqlite3_busy_handler 344 | #define _sqlite3_busy_timeout sqlite3_busy_timeout 345 | #define _sqlite3_changes sqlite3_changes 346 | #define _sqlite3_close sqlite3_close 347 | #define _sqlite3_collation_needed sqlite3_collation_needed 348 | #define _sqlite3_collation_needed16 sqlite3_collation_needed16 349 | #define _sqlite3_column_blob sqlite3_column_blob 350 | #define _sqlite3_column_bytes sqlite3_column_bytes 351 | #define _sqlite3_column_bytes16 sqlite3_column_bytes16 352 | #define _sqlite3_column_count sqlite3_column_count 353 | #define _sqlite3_column_decltype sqlite3_column_decltype 354 | #define _sqlite3_column_decltype16 sqlite3_column_decltype16 355 | #define _sqlite3_column_double sqlite3_column_double 356 | #define _sqlite3_column_int sqlite3_column_int 357 | #define _sqlite3_column_int64 sqlite3_column_int64 358 | #define _sqlite3_column_name sqlite3_column_name 359 | #define _sqlite3_column_name16 sqlite3_column_name16 360 | #define _sqlite3_column_text sqlite3_column_text 361 | #define _sqlite3_column_text16 sqlite3_column_text16 362 | #define _sqlite3_column_type sqlite3_column_type 363 | #define _sqlite3_commit_hook sqlite3_commit_hook 364 | #define _sqlite3_complete sqlite3_complete 365 | #define _sqlite3_complete16 sqlite3_complete16 366 | #define _sqlite3_create_collation sqlite3_create_collation 367 | #define _sqlite3_create_collation16 sqlite3_create_collation16 368 | #define _sqlite3_create_function sqlite3_create_function 369 | #define _sqlite3_create_function16 sqlite3_create_function16 370 | #define _sqlite3_data_count sqlite3_data_count 371 | #define _sqlite3_errcode sqlite3_errcode 372 | #define _sqlite3_errmsg sqlite3_errmsg 373 | #define _sqlite3_errmsg16 sqlite3_errmsg16 374 | #define _sqlite3_exec sqlite3_exec 375 | #define _sqlite3_finalize sqlite3_finalize 376 | #define _sqlite3_free sqlite3_free 377 | #define _sqlite3_free_table sqlite3_free_table 378 | #define _sqlite3_get_table sqlite3_get_table 379 | #define _sqlite3_interrupt sqlite3_interrupt 380 | #define _sqlite3_last_insert_rowid sqlite3_last_insert_rowid 381 | #define _sqlite3_libversion sqlite3_libversion 382 | #define _sqlite3_mprintf sqlite3_mprintf 383 | #define _sqlite3_open sqlite3_open 384 | #define _sqlite3_open16 sqlite3_open16 385 | #define _sqlite3_prepare sqlite3_prepare 386 | #define _sqlite3_prepare16 sqlite3_prepare16 387 | #define _sqlite3_progress_handler sqlite3_progress_handler 388 | #define _sqlite3_reset sqlite3_reset 389 | #define _sqlite3_result_blob sqlite3_result_blob 390 | #define _sqlite3_result_double sqlite3_result_double 391 | #define _sqlite3_result_error sqlite3_result_error 392 | #define _sqlite3_result_error16 sqlite3_result_error16 393 | #define _sqlite3_result_int sqlite3_result_int 394 | #define _sqlite3_result_int64 sqlite3_result_int64 395 | #define _sqlite3_result_null sqlite3_result_null 396 | #define _sqlite3_result_text sqlite3_result_text 397 | #define _sqlite3_result_text16 sqlite3_result_text16 398 | #define _sqlite3_result_text16be sqlite3_result_text16be 399 | #define _sqlite3_result_text16le sqlite3_result_text16le 400 | #define _sqlite3_result_value sqlite3_result_value 401 | #define _sqlite3_set_authorizer sqlite3_set_authorizer 402 | #define _sqlite3_step sqlite3_step 403 | #define _sqlite3_total_changes sqlite3_total_changes 404 | #define _sqlite3_trace sqlite3_trace 405 | #define _sqlite3_user_data sqlite3_user_data 406 | #define _sqlite3_value_blob sqlite3_value_blob 407 | #define _sqlite3_value_bytes sqlite3_value_bytes 408 | #define _sqlite3_value_bytes16 sqlite3_value_bytes16 409 | #define _sqlite3_value_double sqlite3_value_double 410 | #define _sqlite3_value_int sqlite3_value_int 411 | #define _sqlite3_value_int64 sqlite3_value_int64 412 | #define _sqlite3_value_text sqlite3_value_text 413 | #define _sqlite3_value_text16 sqlite3_value_text16 414 | #define _sqlite3_value_text16be sqlite3_value_text16be 415 | #define _sqlite3_value_text16le sqlite3_value_text16le 416 | #define _sqlite3_value_type sqlite3_value_type 417 | #define _sqlite3_vmprintf sqlite3_vmprintf 418 | #endif 419 | 420 | //{{AFX_INSERT_LOCATION}} 421 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 422 | 423 | #endif // !defined(AFX_CPPSQLITE3U_H__1B1BE273_2D1E_439C_946F_3CBD1C0EFD2F__INCLUDED_) 424 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/CDShowMessage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/CDShowMessage.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/CExportExcel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/CExportExcel.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/CommTools.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/CommTools.cpp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/ULib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/ULib.h -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/UiCommTools.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/UiCommTools.aps -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/UiCommTools.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/UiCommTools.rc -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/UiCommTools.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {9E755AE8-5466-40C7-8670-8E18FF30B3D8} 15 | UiCommTools 16 | MFCDLLProj 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | Unicode 23 | Static 24 | 25 | 26 | DynamicLibrary 27 | false 28 | true 29 | Unicode 30 | Static 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) 54 | 55 | 56 | Windows 57 | true 58 | .\UiCommTools.def 59 | 60 | 61 | false 62 | _DEBUG;%(PreprocessorDefinitions) 63 | 64 | 65 | 0x0409 66 | _DEBUG;%(PreprocessorDefinitions) 67 | $(IntDir);%(AdditionalIncludeDirectories) 68 | 69 | 70 | 71 | 72 | Level3 73 | Use 74 | MaxSpeed 75 | true 76 | true 77 | WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions) 78 | 79 | 80 | Windows 81 | true 82 | true 83 | true 84 | .\UiCommTools.def 85 | 86 | 87 | false 88 | NDEBUG;%(PreprocessorDefinitions) 89 | 90 | 91 | 0x0409 92 | NDEBUG;%(PreprocessorDefinitions) 93 | $(IntDir);%(AdditionalIncludeDirectories) 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | Create 107 | Create 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/UiCommTools.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/res/UiCommTools.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/res/UiCommTools.rc2 -------------------------------------------------------------------------------- /UiCommTools/UiCommTools/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanbox/UInterfaceLib/6724d5eda486fe604c13bc1bc11a66d3c53dec56/UiCommTools/UiCommTools/resource.h -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------