:使用共享库的mfc编译出来的程序没有关问题,改为静态库出有关问题了

求助::使用共享库的mfc编译出来的程序没问题,改为静态库出问题了
代码是书上的示例,应该不会错
#include<afxwin.h>
#include<afxtempl.h>
#include"resource.h"

//可串行化的线段类//
class LineSegment:public CObject
{
public:
//起止线
int StartX,StartY,EndX,EndY;
LineSegment();
LineSegment(int,int,int,int);
LineSegment&operator=(LineSegment&);//为serialize准备的
void Serialize(CArchive&);

DECLARE_SERIAL(LineSegment)
};
IMPLEMENT_SERIAL(LineSegment,CObject,1)

LineSegment::LineSegment()
{
StartX=StartY=EndX=EndY=0;
}

LineSegment::LineSegment(int a,int b,int c,int d)
{
StartX=a;
StartY=b;
EndX=c;
EndY=d;
}

//重载操作符//
LineSegment&LineSegment::operator=(LineSegment& s)
{
StartX=s.StartX;
StartY=s.StartY;
EndX=s.EndX;
EndY=s.EndY;
return *this;
}

void LineSegment::Serialize(CArchive& ar)
{
CObject::Serialize(ar);
if(ar.IsStoring())
{
ar<<StartX<<StartY<<EndX<<EndY;
}
else
{
ar>>StartX>>StartY>>EndX>>EndY;
}
}
///////////////////////////////////////////////////////
//文档//
class MyDocument:public CDocument
{
public:
CList<LineSegment,LineSegment&>LineList;
void Serialize(CArchive&);
void DeleteContents();
BOOL CanCloseFrame(CFrameWnd*);

DECLARE_SERIAL(MyDocument)
DECLARE_MESSAGE_MAP()
};
IMPLEMENT_SERIAL(MyDocument,CDocument,1)
BEGIN_MESSAGE_MAP(MyDocument,CDocument)
END_MESSAGE_MAP()

//读取与存储有关的线段//
void  MyDocument::Serialize(CArchive& ar)
{
int Counter;
POSITION pos;
LineSegment line;

CObject::Serialize(ar);

if(ar.IsStoring())
{
ar<<LineList.GetCount();
pos=LineList.GetHeadPosition();
while(pos!=NULL)
LineList.GetNext(pos).Serialize(ar);
}
else
{
ar>>Counter;
for(;Counter;Counter--)
{
line.Serialize(ar);
LineList.AddTail(line);
}
}
}

void MyDocument::DeleteContents()
{
LineList.RemoveAll();
}
//确认是否可以关闭窗口
BOOL MyDocument::CanCloseFrame(CFrameWnd* pFrame)
{
char *title;
if(IsModified())
{
title=new char[pFrame->GetWindowTextLength()+1];
pFrame->GetWindowText(title,pFrame->GetWindowTextLength()+1);
// 警告对话框
if(pFrame->MessageBox("Document not saved!\nwill you close it",title,MB_YESNO)==IDNO)
{
delete title;
return FALSE;