home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / custompalette.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  3.4 KB  |  112 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. // CustomPalette.cpp : Defines the initialization routines for the DLL.
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "CustomPalette.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. //
  24. //    Note!
  25. //
  26. //        If this DLL is dynamically linked against the MFC
  27. //        DLLs, any functions exported from this DLL which
  28. //        call into MFC must have the AFX_MANAGE_STATE macro
  29. //        added at the very beginning of the function.
  30. //
  31. //        For example:
  32. //
  33. //        extern "C" BOOL PASCAL EXPORT ExportedFunction()
  34. //        {
  35. //            AFX_MANAGE_STATE(AfxGetStaticModuleState());
  36. //            // normal function body here
  37. //        }
  38. //
  39. //        It is very important that this macro appear in each
  40. //        function, prior to any calls into MFC.  This means that
  41. //        it must appear as the first statement within the 
  42. //        function, even before any object variable declarations
  43. //        as their constructors may generate calls into the MFC
  44. //        DLL.
  45. //
  46. //        Please see MFC Technical Notes 33 and 58 for additional
  47. //        details.
  48. //
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CCustomPaletteApp
  52.  
  53. BEGIN_MESSAGE_MAP(CCustomPaletteApp, CWinApp)
  54.     //{{AFX_MSG_MAP(CCustomPaletteApp)
  55.         // NOTE - the ClassWizard will add and remove mapping macros here.
  56.         //    DO NOT EDIT what you see in these blocks of generated code!
  57.     //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. // CCustomPaletteApp construction
  62.  
  63. CCustomPaletteApp::CCustomPaletteApp()
  64. {
  65.     // TODO: add construction code here,
  66.     // Place all significant initialization in InitInstance
  67. }
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70. // The one and only CCustomPaletteApp object
  71.  
  72. CCustomPaletteApp theApp;
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CCustomPaletteApp initialization
  76.  
  77. BOOL CCustomPaletteApp::InitInstance()
  78. {
  79.     // Register all OLE server (factories) as running.  This enables the
  80.     //  OLE libraries to create objects from other applications.
  81.     COleObjectFactory::RegisterAll();
  82.  
  83.     return TRUE;
  84. }
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // Special entry points required for inproc servers
  88.  
  89. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  90. {
  91.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  92.     return AfxDllGetClassObject(rclsid, riid, ppv);
  93. }
  94.  
  95. STDAPI DllCanUnloadNow(void)
  96. {
  97.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  98.     return AfxDllCanUnloadNow();
  99. }
  100.  
  101. // by exporting DllRegisterServer, you can use regsvr.exe
  102. STDAPI DllRegisterServer(void)
  103. {
  104.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  105.     COleObjectFactory::UpdateRegistryAll();
  106.     return S_OK;
  107. }
  108. HINSTANCE MyGetResourceHandle()
  109. {
  110.     return theApp.m_hInstance;
  111. }
  112.