123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #include "stdafx.h"
- #include "test.h"
- #include "testDlg.h"
- #include "ODBCImpl.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- BEGIN_MESSAGE_MAP(CtestApp, CWinAppEx)
- ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
- END_MESSAGE_MAP()
- CtestApp::CtestApp()
- {
-
-
- }
- CtestApp theApp;
- BOOL CtestApp::InitInstance()
- {
-
-
-
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
-
-
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
- CWinAppEx::InitInstance();
- AfxEnableControlContainer();
-
-
-
-
- WSADATA WSAData = { 0 };
- if(0 != WSAStartup(MAKEWORD(2, 2), &WSAData))
- {
- MessageBox(0, _T("网络环境初始化失败!"), _T("错误"), MB_OK);
- return FALSE;
- }
-
- Global::GetHostName();
-
- Global::GetIniInfo();
-
- if ( !CODBCImpl::GetInstance()->ConnectToDataBase(Global::g_szConnectString) )
- {
- MessageBox(0, _T("连接数据库失败!"), _T("错误"), MB_OK);
- return FALSE;
- }
-
- INT nUSBPort = 0;
- CHAR szKeypath[MAX_PATH] = {0};
- Encryptlockkernel::ReSetPassWord();
- if ( !Encryptlockkernel::ReadYtInfoVer1(0, Global::g_YtInfoVer1,nUSBPort,szKeypath) )
- {
- MessageBox(0, _T("未找到任何有效的加密锁!"), _T("错误"), MB_OK);
- return FALSE;
- }
-
-
-
-
-
-
-
- SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
- CtestDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
-
-
- }
- else if (nResponse == IDCANCEL)
- {
-
-
- }
-
-
- return FALSE;
- }
|