Sample.cpp
上传用户:szcanmei
上传日期:2007-01-02
资源大小:48k
文件大小:1k
源码类别:

菜单

开发平台:

Visual C++

  1. // A flat popup menu for controls
  2. // Copyright (c) 1999 Andy Brown <andy@mirage.dabsol.co.uk>
  3. // You may do whatever you like with this file, I just don't care.
  4. #include "stdafx.h"
  5. #include "Sample.h"
  6. #include "MainFrm.h"
  7. #include "SampleDoc.h"
  8. #include "SampleView.h"
  9. // The one and only CSampleApp object
  10. CSampleApp theApp;
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. /***************/
  17. /* Message map */
  18. /***************/
  19. BEGIN_MESSAGE_MAP(CSampleApp, CWinApp)
  20. //{{AFX_MSG_MAP(CSampleApp)
  21. //}}AFX_MSG_MAP
  22. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  23. END_MESSAGE_MAP()
  24. /***************/
  25. /* Constructor */
  26. /***************/
  27. CSampleApp::CSampleApp()
  28. {
  29. }
  30. /****************/
  31. /* InitInstance */
  32. /****************/
  33. BOOL CSampleApp::InitInstance()
  34. {
  35. Enable3dControls();
  36. // Register document template
  37. AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,RUNTIME_CLASS(CSampleDoc),RUNTIME_CLASS(CMainFrame),RUNTIME_CLASS(CSampleView)));
  38. // create new document
  39. OnFileNew();
  40. // show the main window
  41. m_pMainWnd->ShowWindow(SW_SHOW);
  42. m_pMainWnd->UpdateWindow();
  43. return TRUE;
  44. }