123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- #include "stdafx.h"
- #include "lyfzServer.h"
- #include "lyfzServerDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- BEGIN_MESSAGE_MAP(ClyfzServerApp, CWinApp)
- ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
- END_MESSAGE_MAP()
- ClyfzServerApp::ClyfzServerApp()
- {
-
- m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
-
-
- }
- ClyfzServerApp theApp;
- BOOL ClyfzServerApp::InitInstance()
- {
-
-
-
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
-
-
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
- CWinApp::InitInstance();
- Global::GetIniInfo();
- CServerPtr::GetInstance()->Start();
- if ( !lyfzCreatePoolInstance() )
- {
- return FALSE;
- }
-
- INT i = 10;
- while (0 == g_pODBCPool->InitializePool(Global::g_szDBSource, Global::g_dwDBServerPort, Global::g_szDBAccount, Global::g_szDBPassWord, Global::g_szDBName, Global::g_dwDBPoolDef, Global::g_dwDBPoolMaxCount))
- {
- Sleep(5000);
- if (i < 0)
- {
- break;
- }
- i--;
- }
- AfxEnableControlContainer();
-
-
- CShellManager *pShellManager = new CShellManager;
-
-
-
-
-
-
-
- SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
- ClyfzServerDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
-
-
- }
- else if (nResponse == IDCANCEL)
- {
-
-
- }
-
- if (pShellManager != NULL)
- {
- delete pShellManager;
- }
-
-
- return FALSE;
- }
- int ClyfzServerApp::ExitInstance()
- {
-
- CServerPtr::GetInstance()->Stop();
- CServerPtr::GetInstance()->Release();
- if ( g_pODBCPool )
- {
- g_pODBCPool->ReleasePool();
- g_pODBCPool->Release();
- g_pODBCPool = NULL;
- }
- FreelyfzodbcLibrary();
- return CWinApp::ExitInstance();
- }
|