www.pudn.com > FEMS.rar > FEMS.cpp
// FEMS.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "FEMS.h"
#include "MainFrm.h"
#include "FEMSDoc.h"
#include "LeftView.h"
#include "odbcinst.h"
#include "PswDlg.h"
#include "PswRecSet.h"
#include "SplashWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFEMSApp
BEGIN_MESSAGE_MAP(CFEMSApp, CWinApp)
//{{AFX_MSG_MAP(CFEMSApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFEMSApp construction
CFEMSApp::CFEMSApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CFEMSApp object
CFEMSApp theApp;
CString CurrentUser;
CString CurrentPass;
// This identifier was generated to be statistically unique for your app.
// You may change it if you prefer to choose a specific identifier.
// {C94ACED9-038A-4F17-BFFC-E09DB9BA126C}
static const CLSID clsid =
{ 0xc94aced9, 0x38a, 0x4f17, { 0xbf, 0xfc, 0xe0, 0x9d, 0xb9, 0xba, 0x12, 0x6c } };
/////////////////////////////////////////////////////////////////////////////
// CFEMSApp initialization
BOOL CFEMSApp::InitInstance()
{
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
SetDialogBkColor (RGB (250, 0, 0), RGB (0, 0, 0,));
CString sPath;
GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
sPath.ReleaseBuffer ();
int nPos;
nPos=sPath.ReverseFind('\\');
sPath=sPath.Left (nPos);
CString lpszFile = sPath + "\\fems.mdb";
char* szDesc;
int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s? UID=;PWD=123;DESCRIPTION=TOC support source? DBQ=%s? FIL=MicrosoftAccess? DEFAULTDIR=%s?? ","FEMS数据库",lpszFile,sPath);
mlen = strlen(szDesc);
for (int i=0; iShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->SetWindowText("琛达5000EVS电力设备可视化管理系统");
m_pMainWnd->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CFEMSApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CFEMSApp message handlers