123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
-
- // ZGKJ.cpp: 定义应用程序的类行为。
- //
- #include "pch.h"
- #include "framework.h"
- #include "ZGKJ.h"
- #include "ZGKJDlg.h"
- #include "Personnel.h"
- #include "SupportStaff.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // CZGKJApp
- BEGIN_MESSAGE_MAP(CZGKJApp, CWinApp)
- ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
- END_MESSAGE_MAP()
- // CZGKJApp 构造
- CZGKJApp::CZGKJApp()
- {
- // 支持重新启动管理器
- m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
- //sql = HtlMysql::GetInstance() ;
- // TODO: 在此处添加构造代码,
- // 将所有重要的初始化放置在 InitInstance 中
- }
- // 唯一的 CZGKJApp 对象
- CZGKJApp theApp;
- // CZGKJApp 初始化
- BOOL CZGKJApp::InitInstance()
- {
-
- CZGKJDlg startdlg;
- //m_pMainWnd = &startdlg;
- INT_PTR nResponse = startdlg.DoModal();
- //startdlg.ShowWindow(1);
- switch (Department_ID)
- {
- case 1:
- {
- Personnel personnel;
- personnel.DoModal();
- }break;
- case 3:
- {
- SupportStaff supportstaff;
- supportstaff.DoModal();
- }
- }
-
- #if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS)
- ControlBarCleanUp();
- #endif
- // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
- // 而不是启动应用程序的消息泵。
- return FALSE;
- }
- char* CZGKJApp::MyTtoA(CString str)
- {
- int length = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
- char* pTemp = new char[length];
- WideCharToMultiByte(CP_ACP, 0, str, -1, pTemp, length, NULL, NULL);
- return pTemp;
- }
- CString CZGKJApp::MyAtoT(const char* c_str)
- {
- int len = MultiByteToWideChar(CP_ACP, 0,c_str, -1, NULL, 0);
- wchar_t* wideStr = new wchar_t[len];
- MultiByteToWideChar(CP_ACP, 0, c_str, -1, wideStr, len);
- CString Tstr(wideStr);
- delete[] wideStr;
- return CString(Tstr);
- }
- int CZGKJApp::MyTtoI(CString str)
- {
- int num = _ttoi(str);
- return num;
- }
- CString CZGKJApp::MyItoT(int num)
- {
- CString str;
- str.Format(_T("%d"), num);
- return CString(str);
- }
|