home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------
- // Copyright @ 1997 TCK Software, Incorporated
- // All Rights Reserved
- // -------------------------------------------------------------------------
-
- // VfHexDoc.h : interface of the CVfHexDoc class
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_VFHEXDOC_H__ACB394C5_9D36_11D1_88FB_00A0C9050951__INCLUDED_)
- #define AFX_VFHEXDOC_H__ACB394C5_9D36_11D1_88FB_00A0C9050951__INCLUDED_
-
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
-
- #define MAX_RECSIZE 1024
-
- class CVfHexDoc : public CDocument
- {
- protected: // create from serialization only
- CVfHexDoc();
- DECLARE_DYNCREATE(CVfHexDoc)
- FILE* m_fdFile;
-
- CString m_fileName; // File Name
- short m_nRecSize; // Size of one record
- long m_nOffset; // Offset to first record
- long m_nRecId; // Current record Id (in m_recData)
- char m_recData[MAX_RECSIZE + 1];
-
- long m_nFileSize; // Size of current file
-
- // Attributes
- public:
- LPCSTR FileName() { return m_fileName; }
- int RecSize() { return m_nRecSize; }
- long Offset() { return m_nOffset; }
-
- long FileSize() { return m_nFileSize; }
- long RecCount(); // rounds Down
- long RecCountHigh(); // rounds UP
- LPCSTR RecData() { return m_recData; }
-
- void FileName(LPCSTR x) { m_fileName = x; }
- void RecSize(int x) { m_nRecSize = x; }
- void Offset(long x) { m_nOffset = x; }
-
- // Operations
- public:
- void InitTB(); // Initialize Toolbar values
- CWnd* GetTbCtl(UINT nCtlId); // Get a toolbar control
- BOOL ReadRecord(long nRecId); // read 1 record from file
- void UseNewFile(LPCSTR szFileName); // Initialize/open a new file
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CVfHexDoc)
- public:
- virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
- //}}AFX_VIRTUAL
-
- // Implementation
- public:
- virtual ~CVfHexDoc();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-
- protected:
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CVfHexDoc)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- afx_msg void OnTbSelect();
- afx_msg void OnTbRecsizeChanged();
- afx_msg void OnTbOffsetChanged();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_VFHEXDOC_H__ACB394C5_9D36_11D1_88FB_00A0C9050951__INCLUDED_)
-