急@@@@在MFC中怎么保存多个鼠标的坐标在txt文件中

急急急@@@@在MFC中如何保存多个鼠标的坐标在txt文件中~
如题~ 需要给出源代码~

------解决方案--------------------
void CtestView::OnMouseMove(UINT nFlags, CPoint point)
{
ofstream txt("yyy.txt"); 
CString str1,str2; 
str1.Format( "%d ",point.x);
str2.Format( "%d ",point.y);

txt.write(str1,strlen(str1));
txt.write(str2,strlen(str2));

}
------解决方案--------------------
vector<POINT> vec;
WM_MOUSEMOVE消息响应函数中采样保存坐标值到vector中,需要的时候格式化为字符串然后CFile::Write写入文件中。
------解决方案--------------------
void CtestView::OnMouseMove(UINT nFlags, CPoint point)
{
ofstream txt("yyy.txt");
CString str1,str2;
str1.Format( "%d ",point.x);
str2.Format( "%d ",point.y);

txt.write(str1,strlen(str1));
txt.write(str2,strlen(str2));

}
这段代码我没有调试过,可能有问题

vector<POINT> vec;
WM_MOUSEMOVE消息响应函数中采样保存坐标值到vector中,需要的时候格式化为字符串然后CFile::Write写入文件中。
这个可借鉴,采样代码是需要的