Permalink
Browse files

MfcApp

  • Loading branch information...
1 parent ddb0bad commit 2f5bc684ed04a362401f296786ee45cd2f1cf539 (no author) committed Aug 20, 2009
Showing with 1,749 additions and 20 deletions.
  1. BIN org/Testplan.xlsx
  2. +59 −0 src/Cfix.Addin/testsolutions/MfcApp/ChildFrm.cpp
  3. +34 −0 src/Cfix.Addin/testsolutions/MfcApp/ChildFrm.h
  4. +102 −0 src/Cfix.Addin/testsolutions/MfcApp/MainFrm.cpp
  5. +41 −0 src/Cfix.Addin/testsolutions/MfcApp/MainFrm.h
  6. +155 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.cpp
  7. +31 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.h
  8. BIN src/Cfix.Addin/testsolutions/MfcApp/MfcApp.ncb
  9. +393 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.rc
  10. +20 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.sln
  11. BIN src/Cfix.Addin/testsolutions/MfcApp/MfcApp.suo
  12. +304 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.vcproj
  13. +65 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcApp.vcproj.three.jp.user
  14. +78 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcAppDoc.cpp
  15. +40 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcAppDoc.h
  16. +99 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcAppView.cpp
  17. +49 −0 src/Cfix.Addin/testsolutions/MfcApp/MfcAppView.h
  18. +17 −0 src/Cfix.Addin/testsolutions/MfcApp/One.cpp
  19. +130 −0 src/Cfix.Addin/testsolutions/MfcApp/ReadMe.txt
  20. +19 −0 src/Cfix.Addin/testsolutions/MfcApp/Resource.h
  21. BIN src/Cfix.Addin/testsolutions/MfcApp/res/MfcApp.ico
  22. +13 −0 src/Cfix.Addin/testsolutions/MfcApp/res/MfcApp.rc2
  23. BIN src/Cfix.Addin/testsolutions/MfcApp/res/MfcAppDoc.ico
  24. BIN src/Cfix.Addin/testsolutions/MfcApp/res/Toolbar.bmp
  25. +7 −0 src/Cfix.Addin/testsolutions/MfcApp/stdafx.cpp
  26. +73 −0 src/Cfix.Addin/testsolutions/MfcApp/stdafx.h
  27. +16 −16 src/Cfix.Addin/testsolutions/VCProjectModuleLoading/ConsExe/ConsExe.vcproj
  28. +4 −0 src/Cfix.Addin/testsolutions/VCProjectModuleLoading/ExportingDll/ExportingDll.vcproj
  29. +0 −4 src/Cfix.Addin/testsolutions/VCProjectModuleLoading/Valid/Valid.vcproj
View
Binary file not shown.
@@ -0,0 +1,59 @@
+// ChildFrm.cpp : implementation of the CChildFrame class
+//
+#include "stdafx.h"
+#include "MfcApp.h"
+
+#include "ChildFrm.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+// CChildFrame
+
+IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
+
+BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
+END_MESSAGE_MAP()
+
+
+// CChildFrame construction/destruction
+
+CChildFrame::CChildFrame()
+{
+ // TODO: add member initialization code here
+}
+
+CChildFrame::~CChildFrame()
+{
+}
+
+
+BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+ // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs
+ if( !CMDIChildWnd::PreCreateWindow(cs) )
+ return FALSE;
+
+ return TRUE;
+}
+
+
+// CChildFrame diagnostics
+
+#ifdef _DEBUG
+void CChildFrame::AssertValid() const
+{
+ CMDIChildWnd::AssertValid();
+}
+
+void CChildFrame::Dump(CDumpContext& dc) const
+{
+ CMDIChildWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+
+// CChildFrame message handlers
@@ -0,0 +1,34 @@
+// ChildFrm.h : interface of the CChildFrame class
+//
+
+
+#pragma once
+
+
+class CChildFrame : public CMDIChildWnd
+{
+ DECLARE_DYNCREATE(CChildFrame)
+public:
+ CChildFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+
+// Implementation
+public:
+ virtual ~CChildFrame();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+// Generated message map functions
+protected:
+ DECLARE_MESSAGE_MAP()
+};
@@ -0,0 +1,102 @@
+// MainFrm.cpp : implementation of the CMainFrame class
+//
+
+#include "stdafx.h"
+#include "MfcApp.h"
+
+#include "MainFrm.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+// CMainFrame
+
+IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
+
+BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
+ ON_WM_CREATE()
+END_MESSAGE_MAP()
+
+static UINT indicators[] =
+{
+ ID_SEPARATOR, // status line indicator
+ ID_INDICATOR_CAPS,
+ ID_INDICATOR_NUM,
+ ID_INDICATOR_SCRL,
+};
+
+
+// CMainFrame construction/destruction
+
+CMainFrame::CMainFrame()
+{
+ // TODO: add member initialization code here
+}
+
+CMainFrame::~CMainFrame()
+{
+}
+
+
+int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
+ return -1;
+
+ if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
+ | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
+ !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
+ {
+ TRACE0("Failed to create toolbar\n");
+ return -1; // fail to create
+ }
+
+ if (!m_wndStatusBar.Create(this) ||
+ !m_wndStatusBar.SetIndicators(indicators,
+ sizeof(indicators)/sizeof(UINT)))
+ {
+ TRACE0("Failed to create status bar\n");
+ return -1; // fail to create
+ }
+
+ // TODO: Delete these three lines if you don't want the toolbar to be dockable
+ m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
+ EnableDocking(CBRS_ALIGN_ANY);
+ DockControlBar(&m_wndToolBar);
+
+ return 0;
+}
+
+BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+ if( !CMDIFrameWnd::PreCreateWindow(cs) )
+ return FALSE;
+ // TODO: Modify the Window class or styles here by modifying
+ // the CREATESTRUCT cs
+
+ return TRUE;
+}
+
+
+// CMainFrame diagnostics
+
+#ifdef _DEBUG
+void CMainFrame::AssertValid() const
+{
+ CMDIFrameWnd::AssertValid();
+}
+
+void CMainFrame::Dump(CDumpContext& dc) const
+{
+ CMDIFrameWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+
+// CMainFrame message handlers
+
+
+
@@ -0,0 +1,41 @@
+// MainFrm.h : interface of the CMainFrame class
+//
+
+
+#pragma once
+
+class CMainFrame : public CMDIFrameWnd
+{
+ DECLARE_DYNAMIC(CMainFrame)
+public:
+ CMainFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+public:
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+
+// Implementation
+public:
+ virtual ~CMainFrame();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected: // control bar embedded members
+ CStatusBar m_wndStatusBar;
+ CToolBar m_wndToolBar;
+
+// Generated message map functions
+protected:
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ DECLARE_MESSAGE_MAP()
+};
+
+
@@ -0,0 +1,155 @@
+// MfcApp.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "MfcApp.h"
+#include "MainFrm.h"
+
+#include "ChildFrm.h"
+#include "MfcAppDoc.h"
+#include "MfcAppView.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+// CMfcAppApp
+
+BEGIN_MESSAGE_MAP(CMfcAppApp, CWinApp)
+ ON_COMMAND(ID_APP_ABOUT, &CMfcAppApp::OnAppAbout)
+ // 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()
+
+
+// CMfcAppApp construction
+
+CMfcAppApp::CMfcAppApp()
+{
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
+}
+
+
+// The one and only CMfcAppApp object
+
+CMfcAppApp theApp;
+
+
+// CMfcAppApp initialization
+
+BOOL CMfcAppApp::InitInstance()
+{
+ // InitCommonControlsEx() is required on Windows XP if an application
+ // manifest specifies use of ComCtl32.dll version 6 or later to enable
+ // visual styles. Otherwise, any window creation will fail.
+ INITCOMMONCONTROLSEX InitCtrls;
+ InitCtrls.dwSize = sizeof(InitCtrls);
+ // Set this to include all the common control classes you want to use
+ // in your application.
+ InitCtrls.dwICC = ICC_WIN95_CLASSES;
+ InitCommonControlsEx(&InitCtrls);
+
+ CWinApp::InitInstance();
+
+ // Initialize OLE libraries
+ if (!AfxOleInit())
+ {
+ AfxMessageBox(IDP_OLE_INIT_FAILED);
+ return FALSE;
+ }
+ AfxEnableControlContainer();
+ // Standard initialization
+ // If you are not using these features and wish to reduce the size
+ // of your final executable, you should remove from the following
+ // the specific initialization routines you do not need
+ // Change the registry key under which our settings are stored
+ // TODO: You should modify this string to be something appropriate
+ // such as the name of your company or organization
+ SetRegistryKey(_T("Local AppWizard-Generated Applications"));
+ LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
+ // Register the application's document templates. Document templates
+ // serve as the connection between documents, frame windows and views
+ CMultiDocTemplate* pDocTemplate;
+ pDocTemplate = new CMultiDocTemplate(IDR_MfcAppTYPE,
+ RUNTIME_CLASS(CMfcAppDoc),
+ RUNTIME_CLASS(CChildFrame), // custom MDI child frame
+ RUNTIME_CLASS(CMfcAppView));
+ if (!pDocTemplate)
+ return FALSE;
+ AddDocTemplate(pDocTemplate);
+
+ // create main MDI Frame window
+ CMainFrame* pMainFrame = new CMainFrame;
+ if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
+ {
+ delete pMainFrame;
+ return FALSE;
+ }
+ m_pMainWnd = pMainFrame;
+ // call DragAcceptFiles only if there's a suffix
+ // In an MDI app, this should occur immediately after setting m_pMainWnd
+
+
+ // Parse command line for standard shell commands, DDE, file open
+ CCommandLineInfo cmdInfo;
+ ParseCommandLine(cmdInfo);
+
+
+ // Dispatch commands specified on the command line. Will return FALSE if
+ // app was launched with /RegServer, /Register, /Unregserver or /Unregister.
+ if (!ProcessShellCommand(cmdInfo))
+ return FALSE;
+ // The main window has been initialized, so show and update it
+ pMainFrame->ShowWindow(m_nCmdShow);
+ pMainFrame->UpdateWindow();
+
+ return TRUE;
+}
+
+
+
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+ CAboutDlg();
+
+// Dialog Data
+ enum { IDD = IDD_ABOUTBOX };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+// Implementation
+protected:
+ DECLARE_MESSAGE_MAP()
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+END_MESSAGE_MAP()
+
+// App command to run the dialog
+void CMfcAppApp::OnAppAbout()
+{
+ CAboutDlg aboutDlg;
+ aboutDlg.DoModal();
+}
+
+
+// CMfcAppApp message handlers
+
Oops, something went wrong.

0 comments on commit 2f5bc68

Please sign in to comment.