app3ds.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #include "stdafx.h"
  11. #ifdef AFX_INIT_SEG
  12. #pragma code_seg(AFX_INIT_SEG)
  13. #endif
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. #ifndef _AFX_NO_CTL3D_SUPPORT
  19. #include "ctl3d.h"
  20. #ifdef __BORLANDC__
  21. #pragma comment(lib, "ctl3d32.lib")
  22. #else
  23. #pragma comment(lib, "ctl3d32s.lib")
  24. #endif
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Support for CTL3D32.LIB (3D controls static library)
  27. BOOL CWinApp::Enable3dControlsStatic()
  28. {
  29. ASSERT(!afxContextIsDLL); // Should only be called by apps
  30. // 3d controls and dialogs are automatic on newer versions of Windows
  31. if (afxData.bWin4)
  32. return TRUE;
  33. // otherwise, attempt to load CTL3D32.DLL
  34. _AFX_CTL3D_STATE* pCtl3dState = _afxCtl3dState;
  35. if (!pCtl3dState->m_bCtl3dInited)
  36. {
  37. // get address of Ctl3d functions
  38. pCtl3dState->m_pfnRegister = &Ctl3dRegister;
  39. pCtl3dState->m_pfnUnregister = &Ctl3dUnregister;
  40. pCtl3dState->m_pfnAutoSubclass = &Ctl3dAutoSubclass;
  41. pCtl3dState->m_pfnUnAutoSubclass = &Ctl3dUnAutoSubclass;
  42. pCtl3dState->m_pfnColorChange = &Ctl3dColorChange;
  43. pCtl3dState->m_pfnSubclassDlgEx = &Ctl3dSubclassDlgEx;
  44. pCtl3dState->m_pfnWinIniChange = &Ctl3dWinIniChange;
  45. pCtl3dState->m_pfnSubclassCtl = &Ctl3dSubclassCtl;
  46. pCtl3dState->m_pfnSubclassCtlEx = &Ctl3dSubclassCtlEx;
  47. // may be incorrect version -- check for errors
  48. if (!pCtl3dState->m_pfnRegister(AfxGetInstanceHandle()))
  49. {
  50. // don't want to be partially initialized
  51. pCtl3dState->m_pfnRegister = NULL;
  52. pCtl3dState->m_pfnUnregister = NULL;
  53. pCtl3dState->m_pfnAutoSubclass = NULL;
  54. pCtl3dState->m_pfnUnAutoSubclass = NULL;
  55. pCtl3dState->m_pfnColorChange = NULL;
  56. pCtl3dState->m_pfnSubclassDlgEx = NULL;
  57. pCtl3dState->m_pfnWinIniChange = NULL;
  58. pCtl3dState->m_pfnSubclassCtl = NULL;
  59. pCtl3dState->m_pfnSubclassCtlEx = NULL;
  60. }
  61. pCtl3dState->m_bCtl3dInited = TRUE;
  62. }
  63. if (pCtl3dState->m_pfnAutoSubclass == NULL)
  64. return FALSE;
  65. // turn on auto subclassing (for primary thread)
  66. return (*pCtl3dState->m_pfnAutoSubclass)(AfxGetInstanceHandle());
  67. }
  68. #endif //!_AFX_NO_CTL3D_SUPPORT
  69. /////////////////////////////////////////////////////////////////////////////