Click here to Skip to main content
15,881,715 members
Articles / Desktop Programming / MFC

The alxBase classes for work with DBF files

Rate me:
Please Sign up or sign in to vote.
5.00/5 (22 votes)
5 Nov 20021 min read 360.8K   3.8K   57  
The alxBase classes for work with dbf files.
// DBTMemoFile.h : interface of the CDBTMemoFile class
//
/////////////////////////////////////////////////////////////////////////////
/*
�����:              �������� �.�.
����������:         alxsoft@gazinter.net
����������:
			��������� ������ � ���� ���� ������� dBASEIV
*/
/////////////////////////////////////////////////////////////////////////////

#if !defined(ALX_DBTMEMOFILE_H__INCLUDED_)
#define ALX_DBTMEMOFILE_H__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "MemoFile.h"


////////////////////////////////////////////////////////////////////////
// CDBTMemoFile - a Memo File

class ALX_EXT_CLASS CDBTMemoFile : public CMemoFile
{

	DECLARE_DYNAMIC(CDBTMemoFile)

// Constructors
public:
	CDBTMemoFile();

// Attributes
public:
	DBT_HEAD	m_DBTHead;	// ��������� ���� ����

// Overridables
public:

// Operations
public:

// Implementation
public:
	~CDBTMemoFile();

	virtual void Open(LPCTSTR lpszName, UINT nOpenFlag);
	virtual void Close();

	// ��� �����
	virtual UINT GetMemoFileType();

	// ������ ���� ����
	virtual void ReadMemoRecord(DBF_ULONG lOffsetRec, DBF_LONG& nLen, CString& strMemo); 
	virtual void ReadMemoRecord(DBF_ULONG lOffsetRec, DBF_LONG& nLen, unsigned char** pMemoData);
	// ���������� ���� ����
	virtual void WriteMemoRecord(DBF_ULONG& lOffsetRec, DBF_LONG& nLen, CString& strMemo);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif


protected:
	BOOL ReadHeader();	// ������ ���������
	BOOL WriteHeader();	// ���������� ���������

private:
	// ��������� ���� ����
	DBF_LONG AddMemoRecord(CString& strMemo);
	// ��������� ���� ����
	void UpdateMemoRecord(DBF_ULONG lOffsetRec, CString& strMemo);
	// ������� ���� ����
	void DeleteMemoRecord(DBF_ULONG lDelRec);
	// �������������� ���� ����
	BOOL UndeleteMemoRecord(DBF_ULONG& lOffsetRec, CString& strMemo);

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(ALX_DBTMEMOFILE_H__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
Year of birth - 1974.
Eeducation - was ended by Kaliningrad State University in 1997.
Now I work as the engineer-programmer in Kaliningrad (RUSSIA).

Comments and Discussions