home *** CD-ROM | disk | FTP | other *** search
- // magnDoc.cpp : implementation of the CMagnifyDoc class
- //
-
- #include "stdafx.h"
- #include "magnify.h"
-
- #include "magnDoc.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- extern CMagnifyApp theApp;
-
- /////////////////////////////////////////////////////////////////////////////
- // CMagnifyDoc
-
- IMPLEMENT_DYNCREATE(CMagnifyDoc, CDocument)
-
- BEGIN_MESSAGE_MAP(CMagnifyDoc, CDocument)
- //{{AFX_MSG_MAP(CMagnifyDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMagnifyDoc construction/destruction
-
- static const WCHAR BASED_CODE _szLicString[] =
- L"LEADTOOLS OCX Copyright (c) 1998 LEAD Technologies, Inc.";
-
- CMagnifyDoc::CMagnifyDoc()
- {
- BSTR lpLic = SysAllocString(_szLicString);
- m_Lead.Create("", 0, CRect(0,0,1,1), theApp.m_pMainWnd, 0,NULL,FALSE,lpLic);
- m_Lead.ShowWindow(SW_HIDE);
- SysFreeString(lpLic);
- UNLOCKSUPPORT(m_Lead);
- }
-
- CMagnifyDoc::~CMagnifyDoc()
- {
- if( IsWindow(m_Lead.m_hWnd) )
- m_Lead.DestroyWindow();
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMagnifyDoc serialization
-
- void CMagnifyDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMagnifyDoc diagnostics
-
- #ifdef _DEBUG
- void CMagnifyDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CMagnifyDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMagnifyDoc commands
-
- BOOL CMagnifyDoc::OnOpenDocument(LPCTSTR lpszPathName)
- {
- int nRet;
- if( lpszPathName )
- {
- nRet = m_Lead.Load(lpszPathName, 0,1,1);
- if( nRet )
- {
- theApp.DisplayLEADError(nRet);
- return FALSE;
- }
- return TRUE;
- }
- else
- return FALSE;
- }
-