CTypedPtrList 为何出现 Access Violation 错误?
为了保存几条线条
定义这样一个变量 CTypedPtrList<CObList,CStroke*> m_strokeList;
如果把这句去掉就不会出现以下Access Violation 错误:
Unhandled exception in xxx.exe(ntdll.dll):0xc0000005:Access Violation
请问为什么会出现这种错误呢?
谢谢!
类CStroke如下:
class CStroke : public CObject
{
public:
CStroke(UINT nPenWidth);
protected:
CStroke();
DECLARE_SERIAL(CStroke)
public:
UINT m_nPenWidth;
CArray<CPoint,CPoint> m_pointArray;
public:
BOOL DrawStroke(CDC* pDC);
void FinishStroke();
virtual void Serialize(CArchive& ar);
};