home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / OCRFRAME.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-27  |  2.1 KB  |  93 lines

  1. // OcrFrame.cpp : implementation of the COcrDemoFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Ocrdemo.h"
  6. #include "OcrFrame.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // COcrDemoFrame
  16.  
  17. IMPLEMENT_DYNCREATE(COcrDemoFrame, CFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(COcrDemoFrame, CFrameWnd)
  20.     //{{AFX_MSG_MAP(COcrDemoFrame)
  21.         // NOTE - the ClassWizard will add and remove mapping macros here.
  22.         //    DO NOT EDIT what you see in these blocks of generated code !
  23.     ON_WM_QUERYNEWPALETTE()
  24.     ON_WM_PALETTECHANGED()
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // COcrDemoFrame construction/destruction
  30.  
  31. COcrDemoFrame::COcrDemoFrame()
  32. {
  33.     // TODO: add member initialization code here
  34.     
  35. }
  36.  
  37. COcrDemoFrame::~COcrDemoFrame()
  38. {
  39. }
  40.  
  41. BOOL COcrDemoFrame::PreCreateWindow(CREATESTRUCT& cs)
  42. {
  43.     // TODO: Modify the Window class or styles here by modifying
  44.     //  the CREATESTRUCT cs
  45.  
  46.     return CFrameWnd::PreCreateWindow(cs);
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // COcrDemoFrame diagnostics
  51.  
  52. #ifdef _DEBUG
  53. void COcrDemoFrame::AssertValid() const
  54. {
  55.     CFrameWnd::AssertValid();
  56. }
  57.  
  58. void COcrDemoFrame::Dump(CDumpContext& dc) const
  59. {
  60.     CFrameWnd::Dump(dc);
  61. }
  62.  
  63. #endif //_DEBUG
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // COcrDemoFrame message handlers
  67.  
  68. BOOL COcrDemoFrame::OnQueryNewPalette() 
  69. {
  70.     if (GetActiveFrame() != this)
  71.    {
  72.         return FALSE;
  73.    }
  74.  
  75.     CView* pView = GetActiveView();
  76.  
  77.     return (BOOL)pView->SendMessage(WM_DOREALIZE, (WPARAM)m_hWnd, (LPARAM)FALSE);
  78. }
  79.  
  80. void COcrDemoFrame::OnPaletteChanged(CWnd* pFocusWnd) 
  81. {
  82.     CFrameWnd::OnPaletteChanged(pFocusWnd);
  83.  
  84.     if (GetActiveFrame() != this)
  85.    {
  86.         return;
  87.    }
  88.  
  89.    SendMessageToDescendants(WM_DOREALIZE, (WPARAM)pFocusWnd->m_hWnd, (LPARAM)TRUE);
  90. }
  91.  
  92. /////////////////////////////////////////////////////////////////////////////
  93.