我在画直线程序中设置了如下函数
void CGraphExpDoc::AddLine(CPoint pntStart,CPoint pntEnd,CColor c_Color,int linestyle)
{
CLine Line(pntStart,pntEnd,c_Color,linestyle);
m_vLines.push_back(Line);
SetModifiedFlag();
}
CLine定义如下
class CLine
{
public:
int m_LineStyle;
CLine(const CLine &line);
CColor c_Color;
CLine();
CPoint m_pntStart;
CPoint m_pntEnd;
CLine(CPoint pntStart,CPoint pntEnd,CColor color,int linestyle);
void DrawLine(CDC *pDC); virtual ~CLine();};
但是调试以后发现Line进栈以后linestyle对应的m_LineStyle为乱码,显示如下
[0] 0x00401127 CLine::`vector deleting destructor'(unsigned int)
而其他变量正常,请问这是为什么?
void CGraphExpDoc::AddLine(CPoint pntStart,CPoint pntEnd,CColor c_Color,int linestyle)
{
CLine Line(pntStart,pntEnd,c_Color,linestyle);
m_vLines.push_back(Line);
SetModifiedFlag();
}
CLine定义如下
class CLine
{
public:
int m_LineStyle;
CLine(const CLine &line);
CColor c_Color;
CLine();
CPoint m_pntStart;
CPoint m_pntEnd;
CLine(CPoint pntStart,CPoint pntEnd,CColor color,int linestyle);
void DrawLine(CDC *pDC); virtual ~CLine();};
但是调试以后发现Line进栈以后linestyle对应的m_LineStyle为乱码,显示如下
[0] 0x00401127 CLine::`vector deleting destructor'(unsigned int)
而其他变量正常,请问这是为什么?
解决方案 »
- GDI+头文件GdiplusTypes.h
- 如何判断电脑是从注销后起来的??
- 急求!用opengl实现三维人的表情动作的算法!先谢谢
- 求:open source的microsoft doc/docx的读取程序,不依赖于.Net
- 天天看你叫着啥普及历史之类的,为你的网站打广告,今天咋歇起来了?
- 点击对话框上的一个按钮就输出文本~~~
- 链表数据的串行化出问题!急。。。。
- vc6.0的调试问题,寻求大家帮助
- MFC 如何避免在按上下左右按键的时候有对话框上的按钮被选中
- 如何实现在图像中输入四个点的位置,自动画出一个矩形
- 用VC,编译时出的一个错!
- CORBA中间件visiBroker产品与omniORB产品能否进行通信?
这一行之后m_LineStyle才有效
其他正常
构造函数里面定义好linestyle没的? push_back实际上是一个对象的拷贝