home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / FERRAMEN / VBXSTD12 / 3DDEMO.CP_ / 3DDEMO.CPP
Encoding:
C/C++ Source or Header  |  1994-08-23  |  1.9 KB  |  87 lines

  1. // 3ddemo.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "vbxdemo.h"
  6. #include "resources.h"
  7. #include "3ddemo.h"
  8.  
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // C3DDemo dialog
  16.  
  17.  
  18. C3DDemo::C3DDemo(CWnd* pParent /*=NULL*/)
  19.     : CDialog(C3DDemo::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(C3DDemo)
  22.     VB3D1 = NULL;
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26. void C3DDemo::DoDataExchange(CDataExchange* pDX)
  27. {
  28.     CDialog::DoDataExchange(pDX);
  29.     //{{AFX_DATA_MAP(C3DDemo)
  30.     DDX_VB3D(pDX, IDC_VB3D1, VB3D1);
  31.     //}}AFX_DATA_MAP
  32. }
  33.  
  34. BEGIN_MESSAGE_MAP(C3DDemo, CDialog)
  35.     //{{AFX_MSG_MAP(C3DDemo)
  36.     ON_BN_CLICKED(IDHELP, OnHelp)
  37.     ON_WM_PAINT()
  38.     ON_WM_DESTROY()
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // C3DDemo message handlers
  45.  
  46. void C3DDemo::OnHelp()
  47. {
  48.     CString FAR szWinDir, szName, szMsg;
  49.     GetSystemDirectory( szWinDir.GetBuffer(250), 248 );
  50.     szWinDir.ReleaseBuffer();
  51.     if ( szWinDir.GetLength() > 3 )
  52.         szWinDir += "\\";
  53.     szName = szWinDir;
  54.     szName += "VBXSTD12.HLP";
  55.     if ( !IsHlpHere() )
  56.         return;
  57.     ::WinHelp( m_hWnd, szName, HELP_KEY, (long)"VB3D" );
  58.  
  59. }
  60.                                           
  61. BOOL C3DDemo::OnInitDialog()
  62. {
  63.     CDialog::OnInitDialog();
  64.     
  65.     VB3D1->GetVBX()->AddItem("Edit", 0);
  66.     SetDlgItemText( IDC_EDIT1, "This is a standard Edit control..." );
  67.     if ( !IsHlpHere() )
  68.         GetDlgItem( IDHELP )->EnableWindow( FALSE );
  69.         
  70.     return TRUE;  // return TRUE  unless you set the focus to a control
  71. }                                        
  72.  
  73.  
  74. void C3DDemo::OnPaint()
  75. {
  76.     CPaintDC dc(this); // device context for painting
  77.     VB3D1->GetVBX()->Refresh(); // required with VC++
  78.     
  79. }
  80.  
  81.  
  82. void C3DDemo::OnDestroy()
  83. {
  84.     CDialog::OnDestroy();
  85.     ::WinHelp( m_hWnd, "VBXSTD12.HLP", HELP_QUIT, NULL );    
  86. }
  87.