xiaobin_hlj80

https://blog.csdn.net/xiaobin_HLJ80 http://blog.chinaunix.net/uid/31552151.html

导航

ODBC3 - MFC

  • NOTE: The database wizard is no longer provided in VS2017 and later versions.

mfc_app_wizard6c-vc12
(Figure: Step 6 of the MFC Application Wizard in Visual Studio 2013)

operation data

// CMFCApplication1View database support
CRecordset* CMFCApplication1View::OnGetRecordset()
{
	return m_pSet;
}

declare

// Overrides
public:
	virtual CRecordset* OnGetRecordset();

invoke CRec1Set

  • member
// Attributes
public:
	CRec1Set m_Rec1Set;

at "MFCApplication1Doc.h"

init

Initialization is performed in "MFCApplication1View.cpp".

	// TODO: add construction code here
	m_pSet = nullptr;

define

public:
#ifdef AFX_DESIGN_TIME
	enum{ IDD = IDD_MFCAPPLICATION1_FORM };
#endif
	CRec1Set* m_pSet;

at "MFCApplication1View.h"

OnInitialUpdate

  • old
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();
  • new
	m_pSet = &GetDocument()->m_Rec1Set;
	CRecordView::OnInitialUpdate();

member functions(GetDocument()) to support processing of that data.

Ref

  • CRecordView Class
  • Chapter 12: Windows Programming with the Microsoft Foundation Classes (MFC) - Beginning Visual C++ 2013

posted on 2026-09-27 07:09  xiaobin80  阅读(5)  评论(0)    收藏  举报