home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / makedwg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  3.5 KB  |  107 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11. // MakeDwg.cpp : Defines the class behaviors for the application.
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "MakeDwg.h"
  16. #include "MDDialog.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMakeDwgApp
  26. // This example demostrates some manipulations with TurboCAD's objects
  27. // (Create new drawing, open existing drawing, save drawing, add primitives into the drawign, etc)
  28. BEGIN_MESSAGE_MAP(CMakeDwgApp, CWinApp)
  29.     //{{AFX_MSG_MAP(CMakeDwgApp)
  30.         // NOTE - the ClassWizard will add and remove mapping macros here.
  31.         //    DO NOT EDIT what you see in these blocks of generated code!
  32.     //}}AFX_MSG
  33.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CMakeDwgApp construction
  38.  
  39. CMakeDwgApp::CMakeDwgApp()
  40. {
  41.     // TODO: add construction code here,
  42.     // Place all significant initialization in InitInstance
  43. }
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // The one and only CMakeDwgApp object
  47.  
  48. CMakeDwgApp theApp;
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMakeDwgApp initialization
  52.  
  53. BOOL CMakeDwgApp::InitInstance()
  54. {
  55.     // Initialize OLE libraries
  56.     if (!AfxOleInit())
  57.     {
  58.         AfxMessageBox(IDP_OLE_INIT_FAILED);
  59.         return FALSE;
  60.     }
  61.  
  62.     // Standard initialization
  63.     // If you are not using these features and wish to reduce the size
  64.     //  of your final executable, you should remove from the following
  65.     //  the specific initialization routines you do not need.
  66.  
  67. #ifdef _AFXDLL
  68.     Enable3dControls();            // Call this when using MFC in a shared DLL
  69. #else
  70.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  71. #endif
  72.  
  73.     // Parse the command line to see if launched as OLE server
  74.     if (RunEmbedded() || RunAutomated())
  75.     {
  76.         // Register all OLE server (factories) as running.  This enables the
  77.         //  OLE libraries to create objects from other applications.
  78.         COleTemplateServer::RegisterAll();
  79.  
  80.         // Application was run with /Embedding or /Automation.  Don't show the
  81.         //  main window in this case.
  82.         return TRUE;
  83.     }
  84.  
  85.     // When a server application is launched stand-alone, it is a good idea
  86.     //  to update the system registry in case it has been damaged.
  87.     COleObjectFactory::UpdateRegistryAll();
  88.  
  89.     CMakeDwgDlg dlg;
  90.     m_pMainWnd = &dlg;
  91.     int nResponse = dlg.DoModal();
  92.     if (nResponse == IDOK)
  93.     {
  94.         // TODO: Place code here to handle when the dialog is
  95.         //  dismissed with OK
  96.     }
  97.     else if (nResponse == IDCANCEL)
  98.     {
  99.         // TODO: Place code here to handle when the dialog is
  100.         //  dismissed with Cancel
  101.     }
  102.  
  103.     // Since the dialog has been closed, return FALSE so that we exit the
  104.     //  application, rather than start the application's message pump.
  105.     return FALSE;
  106. }
  107.