接第七节内容
1.在student.h中加头文件#include<afxdb.h>;
2.在view.cpp中加头文件#include“student.h“;
3.创建OnRButtonDown函数;
4.改变OnLButtonDown函数中的固定显示坐标即可;
1.在student.h中加头文件#include<afxdb.h>;
2.在view.cpp中加头文件#include“student.h“;
3.创建OnRButtonDown函数;
4.改变OnLButtonDown函数中的固定显示坐标即可;
void CDdView::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CStudent rs;
int y=20;
CClientDC dc(this);
rs.Open();
CString strTemp;
while(!rs.IsEOF())
{
strTemp.Format("id:%s,name:%s,english:%d",rs.m_ID,rs.m_name,rs.m_english);
rs.MoveNext();
dc.TextOut(20,y,strTemp);
y+=20;
}
CView::OnRButtonDown(nFlags, point);
}