//{{NO_DEPENDENCIES}}
// App Studio generated include file.
// Used by TYSSQL.RC
//
#define IDR_MAINFRAME 2
#define IDD_ABOUTBOX 100
#define IDD_TYSSQL_FORM 101
#define IDP_FAILED_OPEN_DATABASE 103
#define IDC_NAME 1000
#define IDC_ADDRESS 1001
#define IDC_STATE 1002
#define IDC_ZIP 1003
// Next default values for new
objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
SQL 21 日自学通(V1.0) 翻译人笨猪
509
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
///////////////////////////////////////////////////
// mainfrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
// Operations
public:
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
SQL 21 日自学通(V1.0) 翻译人笨猪
510
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// tyssqvw.cpp : implementation of the CTyssqlView class
//
#include "stdafx.h"
#include "tyssql.h"
#include "tyssqset.h"
#include "tyssqdoc.h"
#include "tyssqvw.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTyssqlView
IMPLEMENT_DYNCREATE(CTyssqlView, CRecordView)
BEGIN_MESSAGE_MAP(CTyssqlView, CRecordView)
//{{AFX_MSG_MAP(CTyssqlView)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CTyssqlView construction/destruction
SQL 21 日自学通(V1.0) 翻译人笨猪
511
CTyssqlView::CTyssqlView()
: CRecordView(CTyssqlView::IDD)
{
//{{AFX_DATA_INIT(CTyssqlView)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CTyssqlView::~CTyssqlView()
{ }
void CTyssqlView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTyssqlView)
DDX_FieldText(pDX, IDC_ADDRESS, m_pSet->m_ADDRESS, m_pSet);
DDX_FieldText(pDX, IDC_NAME, m_pSet->m_NAME, m_pSet);
DDX_FieldText(pDX, IDC_STATE, m_pSet->m_STATE, m_pSet);
DDX_FieldText(pDX, IDC_ZIP, m_pSet->m_ZIP, m_pSet);
//}}AFX_DATA_MAP
}
void CTyssqlView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_tyssqlSet;
CRecordView::OnInitialUpdate();
}
/////////////////////////////////////////////////////////////////////////////
// CTyssqlView diagnostics
#ifdef _DEBUG
void CTyssqlView::AssertValid() const
SQL 21 日自学通(V1.0) 翻译人笨猪
512
{
CRecordView::AssertValid();
}
void CTyssqlView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CTyssqlDoc* CTyssqlView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTyssqlDoc)));
return (CTyssqlDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTyssqlView database support
CRecordset* CTyssqlView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CTyssqlView message handlers
// tyssqset.cpp : implementation of the CTyssqlSet class
//
#include "stdafx.h"
#include "tyssql.h"
#include "tyssqset.h"
/////////////////////////////////////////////////////////////////////////////
// CTyssqlSet implementation
IMPLEMENT_DYNAMIC(CTyssqlSet, CRecordset)
CTyssqlSet::CTyssqlSet(CDatabase* pdb)
SQL 21 日自学通(V1.0) 翻译人笨猪
513
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CTyssqlSet)
m_NAME = "";
m_ADDRESS = "";
m_STATE = "";
m_ZIP = "";
m_PHONE = "";
m_REMARKS = "";
m_nFields = 6;
//}}AFX_FIELD_INIT
}
CString CTyssqlSet::GetDefaultConnect()
{
return "ODBC;DSN=TYSSQL;";
}
CString CTyssqlSet::GetDefaultSQL()
{
return "SELECT * FROM CUSTOMER ORDER BY NAME";
}
void CTyssqlSet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CTyssqlSet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, "NAME", m_NAME);
RFX_Text(pFX, "ADDRESS", m_ADDRESS);
RFX_Text(pFX, "STATE", m_STATE);
RFX_Text(pFX, "ZIP", m_ZIP);
RFX_Text(pFX, "PHONE", m_PHONE);
RFX_Text(pFX, "REMARKS", m_REMARKS);
SQL 21 日自学通(V1.0) 翻译人笨猪
514
//}}AFX_FIELD_MAP
}
// tyssql.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "tyssql.h"
#include "mainfrm.h"
#include "tyssqset.h"
#include "tyssqdoc.h"
#include "tyssqvw.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTyssqlApp
BEGIN_MESSAGE_MAP(CTyssqlApp, CWinApp)
//{{AFX_MSG_MAP(CTyssqlApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CTyssqlApp construction
CTyssqlApp::CTyssqlApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
SQL 21 日自学通(V1.0) 翻译人笨猪
515
/////////////////////////////////////////////////////////////////////////////
// The one and only CTyssqlApp
objectCTyssqlApp NEAR theApp;
/////////////////////////////////////////////////////////////////////////////
// CTyssqlApp initialization
BOOL CTyssqlApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
SetDialogBkColor(); // Set dialog background color to gray
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTyssqlDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CTyssqlView));
AddDocTemplate(pDocTemplate);
// create a new (empty) document
OnFileNew();
if (m_lpCmdLine[0] != '\0')
{
// TODO: add command line processing here
}
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////