vector 和 CObject
2017-01-19 05:54
148 查看
#include <afxwin.h> #pragma once class CLine : public CObject { public: DECLARE_SERIAL(CLine); public: void Serialize(CArchive & ar); CLine(); CLine(CPoint fro,CPoint to); public: CPoint m_ptFrom; CPoint m_ptTo; };
#include <afxwin.h> #include <vector> #include "CLine.h" #pragma once using namespace std; class CMainWindow : public CFrameWnd { public: CMainWindow(); CButton open; CButton save; afx_msg void fnopen(); afx_msg void fnsave(); vector<CLine> lines; CPoint from; CPoint to; afx_msg void OnLButtonDown(UINT nFlags,CPoint point); afx_msg void OnLButtonUp (UINT nFlags,CPoint point); DECLARE_MESSAGE_MAP() };
void CMainWindow::OnLButtonUp (UINT nFlags,CPoint point) { CClientDC dc(this); dc.MoveTo (from); dc.LineTo (point); CLine li(from,to); lines.push_back (li); }
1>------ 已启动生成: 项目: ARchive, 配置: Debug Win32 ------
1>正在编译...
1>CLine.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>CMainWindow.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>c:\users\administrator\desktop\archive\archive\cline.h(17) : error C2248: “CObject::CObject”: 无法访问 private 成员(在“CObject”类中声明)
1> d:\vc++ 2008\vc\atlmfc\include\afx.h(551) : 参见“CObject::CObject”的声明
1> d:\vc++ 2008\vc\atlmfc\include\afx.h(522) : 参见“CObject”的声明
1> 此诊断出现在编译器生成的函数“CLine::CLine(const CLine &)”中
1>正在生成代码...
1>正在跳过...(未检测到相关更改)
1>App.cpp
1>生成日志保存在“file://c:\Users\Administrator\Desktop\ARchive\ARchive\Debug\BuildLog.htm”
1>ARchive - 1 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
相关文章推荐
- 由于添加vector造成的error C2248: 'CObject::operator =' :问题解决方法
- C++标准库vector类(简单用法记录)
- Leetcode-231.Flatten 2D Vector
- 顺序容器(vector、deque、list、forward_list、array 、string)
- STL 标准模板库 vector queue list map multimap的使用基础
- 标准库 vector 类型
- 机器学习技法课程学习笔记6-- Support Vector Regression
- vector表示十字链表+Tarjan+缩点+拓扑排序 详解 poj 2762
- vector:
- Numerical C++(1) vector
- (转)vector中使用erase删除…
- java提高篇(二九)-----Vector
- vector的实现【C++】 4000
- java中Vector,ArrayList,List使用剖析
- C++读取文件夹中特定后缀的文件—dirent—vector
- Java 集合:Collection,List,ArrayList,Vector,LinkedList(实现方式,对比)
- 浅析java中ArrayList与Vector的区别以及HashMap与Hashtable的区别
- HDU 找出直系亲属 (dfs+vector)
- ArrayList和Vector和LinkedList的区别
- Support Vector Machine Algorithm For Regression(SVR)算法详细解析