KmMatch.cpp
上传用户:hell82222
上传日期:2013-12-19
资源大小:1872k
文件大小:19k
- // KmMatch.cpp: implementation of the KmMatch class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "KmMatch.h"
- #include "DwgReader.h"
- #include "KmEntity.h"
- #include "Reader.h"
- #include "Database.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- extern CStdioFile g_CensorialFile; //监察转换进度的文件
- extern int g_mode;
- CMatch1::CMatch1()
- {
- }
- CMatch1::~CMatch1()
- {
- }
- CMatchList1::CMatchList1()
- {
- }
- CMatchList1::~CMatchList1()
- {
- ReInit();
- }
- void CMatchList1::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- void CMatchList1::Add(AD_OBJHANDLE handle,int ltype,double lscale,short sindex) //添加到列表中
- {
- CMatch1* match=new CMatch1;
- memcpy(match->m_handle,handle,8);
- match->m_ltype=ltype;
- match->m_lscale=lscale;
- match->m_index=sindex;
- m_List.AddTail(match);
- }
- short CMatchList1::Get(AD_OBJHANDLE handle,int <ype,double &lscale) //添加到列表中
- {
- CMatch1* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_handle[0]==handle[0])
- {
- if(match->m_handle[1]==handle[1])
- {
- if(match->m_handle[2]==handle[2])
- {
- if(match->m_handle[3]==handle[3])
- {
- if(match->m_handle[4]==handle[4])
- {
- if(match->m_handle[5]==handle[5])
- {
- if(match->m_handle[6]==handle[6])
- {
- if(match->m_handle[7]==handle[7])
- {
- ltype=match->m_ltype;
- lscale=match->m_lscale;
- return match->m_index;
- }}}}}}}}
- }
- ltype=SOLID_LINE;
- lscale=1;
- _WRITE(str.Format("*句柄%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- return 0;
- }
- void CMatchList1::Get(AD_OBJHANDLE& handle,int ltype) //添加到列表中
- {
- CMatch1* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_ltype==ltype)
- {
- adHancpy(handle,match->m_handle);
- return ;
- }
- }
- _WRITE(str.Format("线形链表中的第%d种线形不存在",ltype));
- if(m_List.GetCount()>0)
- {
- adHancpy(handle,m_List.GetHead()->m_handle);
- }
- return ;
- }
- int CMatchList1::Get(short sindex)
- {
- CMatch1* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_index==sindex)
- {
- return match->m_ltype;
- }
- }
- _WRITE(str.Format("线形链表中的第%d号线形不存在",sindex));
- return SOLID_LINE;
- }
- POSITION CMatchList1::GetHeadPosition()
- {
- return m_List.GetHeadPosition();
- }
- CMatch1* CMatchList1::GetNext(POSITION& pos)
- {
- return m_List.GetNext(pos);
- }
- CMatch2::CMatch2()
- {
- m_bUseful=TRUE;
- }
- CMatch2::~CMatch2()
- {
- }
- CMatchList2::CMatchList2()
- {
- }
- CMatchList2::~CMatchList2()
- {
- ReInit();
- }
- void CMatchList2::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- void CMatchList2::Add(AD_OBJHANDLE handle,UINT id,double lscale,BOOL bRef) //添加到列表中
- {
- CMatch2* match=new CMatch2;
- memcpy(match->m_handle,handle,8);
- match->m_id=id;
- match->m_lscale=lscale;
- match->m_bRef=bRef;
- m_List.AddTail(match);
- }
- void CMatchList2::Get(AD_OBJHANDLE handle,UINT &id,double &lscale) //添加到列表中
- {
- CMatch2* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_handle[0]==handle[0])
- {
- if(match->m_handle[1]==handle[1])
- {
- if(match->m_handle[2]==handle[2])
- {
- if(match->m_handle[3]==handle[3])
- {
- if(match->m_handle[4]==handle[4])
- {
- if(match->m_handle[5]==handle[5])
- {
- if(match->m_handle[6]==handle[6])
- {
- if(match->m_handle[7]==handle[7])
- {
- if(!match->m_bUseful)
- {
- id=0;
- }
- else
- {
- id=match->m_id;
- }
- lscale=match->m_lscale;
- return;
- }}}}}}}}
- }
- id=0;
- lscale=1.0;
- _WRITE(str.Format("*句柄%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- return ;
- }
- BOOL CMatchList2::Get(AD_OBJHANDLE &handle,UINT id) //添加到列表中
- {
- CMatch2* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_id==id)
- {
- adHancpy(handle,match->m_handle);
- return TRUE;
- }
- }
- _WRITE(str.Format("层%d没有在匹配链表中找到匹配项",id));
- if(m_List.GetCount()>0)
- {
- adHancpy(handle,m_List.GetHead()->m_handle);
- return TRUE;
- }
- return FALSE;
- }
- BOOL CMatchList2::Get(UINT& id,AD_OBJHANDLE handle) //添加到列表中
- {
- CMatch2* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_handle[0]==handle[0])
- {
- if(match->m_handle[1]==handle[1])
- {
- if(match->m_handle[2]==handle[2])
- {
- if(match->m_handle[3]==handle[3])
- {
- if(match->m_handle[4]==handle[4])
- {
- if(match->m_handle[5]==handle[5])
- {
- if(match->m_handle[6]==handle[6])
- {
- if(match->m_handle[7]==handle[7])
- {
- id=match->m_id;
- return TRUE;
- }}}}}}}}
- }
- return FALSE;
- }
- POSITION CMatchList2::GetHeadPosition()
- {
- return m_List.GetHeadPosition();
- }
- CMatch2* CMatchList2::GetNext(POSITION& pos)
- {
- return m_List.GetNext(pos);
- }
- CMatch3::CMatch3()
- {
- m_iplotsheet=-1;
- }
- CMatch3::~CMatch3()
- {
- }
- CMatch4::CMatch4()
- {
- }
- CMatch4::~CMatch4()
- {
- segcolor.RemoveAll();
- segltyle.RemoveAll();
- }
- CShape::CShape()
- {
- m_bUseSHX=FALSE;
- m_strShapefilename.Empty();
- m_strBigFontfilename.Empty();
- m_strShapename.Empty();
- m_lShapeCapacity=0;
- m_utShapeflag1=0;
- m_utShapeflag2=0;
- m_dShapeAngle=0;
- m_dShapeHeight=0;
- m_dShapeWidth=0;
- m_KmWordStyleID=1;
- }
- CShape::~CShape()
- {
- }
- //DEL void CShape::Analyse(CStdioFile* file)
- //DEL {
- //DEL char ch;
- //DEL char ch1,ch2;//,ch3,ch4,ch5;
- //DEL //绘图模式 =true移动并绘制 =false移动不绘制
- //DEL BOOL bdraw=TRUE;
- //DEL //单位矢量的长度
- //DEL double dscale=1;
- //DEL double x=0;
- //DEL double y=0;
- //DEL CList<double,double>xstack;
- //DEL CList<double,double>ystack;
- //DEL do
- //DEL {
- //DEL ch=0;
- //DEL if(!file->Read(&ch,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL switch(ch)
- //DEL {
- //DEL case 1://激活绘图模式(落笔)
- //DEL bdraw=TRUE;
- //DEL break;
- //DEL case 2://停止绘图模式(提笔)
- //DEL bdraw=FALSE;
- //DEL break;
- //DEL case 3://将矢量长度除以下一字节
- //DEL if(!file->Read(&ch1,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL dscale*=(unsigned char)ch1;
- //DEL break;
- //DEL case 4://将矢量长度乘以下一字节
- //DEL if(!file->Read(&ch1,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL dscale/=(unsigned char)ch1;
- //DEL break;
- //DEL case 5://将当前位置压入堆栈
- //DEL xstack.AddTail(x);
- //DEL ystack.AddTail(y);
- //DEL break;
- //DEL case 6://从堆栈弹出当前位置
- //DEL if(xstack.GetTailPosition()!=NULL)
- //DEL {
- //DEL x=xstack.RemoveTail();
- //DEL }
- //DEL if(ystack.GetTailPosition()!=NULL)
- //DEL {
- //DEL y=ystack.RemoveTail();
- //DEL }
- //DEL break;
- //DEL case 7://绘制编号由下一字节指定的子形
- //DEL if(!file->Read(&ch1,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL break;
- //DEL case 8://由下两个字节指定的 X-Y 位移
- //DEL if(!file->Read(&ch1,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL if(!file->Read(&ch2,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL AddLine(x,y,ch1*dscale,ch2*dscale);
- //DEL break;
- //DEL case 9://多个 X-Y 位移,以 (0,0) 终止
- //DEL do
- //DEL {
- //DEL if(!file->Read(&ch1,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL if(!file->Read(&ch2,1))
- //DEL {
- //DEL return;
- //DEL }
- //DEL AddLine(x,y,ch1*dscale,ch2*dscale);
- //DEL }while((ch1!=0)&&(ch2!=0));
- //DEL break;
- //DEL case 10://由下两个字节定义的八分圆弧
- //DEL file->Read(&ch,1);
- //DEL file->Read(&ch,1);
- //DEL break;
- //DEL case 11://由下五个字节定义的分数圆弧
- //DEL file->Read(&ch,1);
- //DEL file->Read(&ch,1);
- //DEL file->Read(&ch,1);
- //DEL file->Read(&ch,1);
- //DEL file->Read(&ch,1);
- //DEL break;
- //DEL case 12://由 X-Y 位移和凸度定义的圆弧
- //DEL case 13://多个指定凸度的圆弧
- //DEL break;
- //DEL case 14://仅对垂直文字执行下一命令
- //DEL break;
- //DEL default://矢量长度和方向代码
- //DEL break;
- //DEL }
- //DEL }while(ch!=0);
- //DEL }
- //DEL void CShape::AddLine(double& x,double& y,double offsetx,double offsety)
- //DEL {
- //DEL KmLine* pLine=new KmLine;
- //DEL pLine->bx=x;
- //DEL pLine->by=y;
- //DEL x+=offsetx;
- //DEL y+=offsety;
- //DEL pLine->ex=x;
- //DEL pLine->ey=y;
- //DEL m_objs.AddTail(pLine);
- //DEL }
- CMatch5::CMatch5()
- {
- m_shape=NULL;
- }
- CMatch5::~CMatch5()
- {
- if(m_shape)
- {
- try
- {
- delete m_shape;
- }
- catch(...)
- {
- }
- }
- }
- CMatch6::CMatch6()
- {
- }
- CMatch6::~CMatch6()
- {
- }
- //DEL BOOL CMatch5::Load(CString filename)
- //DEL {
- //DEL m_shapes.SetSize(0);
- //DEL
- //DEL CFileFind filefind;
- //DEL if(!filefind.FindFile(filename))
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL
- //DEL CStdioFile file;
- //DEL file.Open(filename,CFile::modeRead|CFile::typeBinary|CFile::shareDenyNone);
- //DEL
- //DEL CString strTemp;
- //DEL if(!file.ReadString(strTemp))
- //DEL {
- //DEL _WRITE(str="形文件"+filename+"格式错误");
- //DEL return FALSE;
- //DEL }
- //DEL _WRITE(str="分析形文件"+strTemp+"_"+filename);
- //DEL
- //DEL char ch;
- //DEL int count;
- //DEL for(int j=0;j<5;j++)
- //DEL {
- //DEL if(!file.Read(&ch,1))
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL }
- //DEL if(!file.Read(&ch,1))
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL count=ch;
- //DEL if(count<=0)
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL if(!file.Read(&ch,1))
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL if(ch!=0)
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL for(int i=0;i<count;i++)
- //DEL {
- //DEL for(j=0;j<4;j++)
- //DEL {
- //DEL if(!file.Read(&ch,1))
- //DEL {
- //DEL return FALSE;
- //DEL }
- //DEL }
- //DEL }
- //DEL CShape* pshape;
- //DEL m_shapes.SetSize(count);
- //DEL for(i=0;i<count;i++)
- //DEL {
- //DEL pshape=new CShape;
- //DEL pshape->m_indexinfile=i+1;
- //DEL strTemp.Empty();
- //DEL do
- //DEL {
- //DEL if(!file.Read(&ch,1))
- //DEL {
- //DEL delete pshape;
- //DEL return FALSE;
- //DEL }
- //DEL strTemp+=ch;
- //DEL }while(ch!=0);
- //DEL pshape->m_strname=strTemp;
- //DEL
- //DEL pshape->Analyse(&file);
- //DEL
- //DEL m_shapes[i]=pshape;
- //DEL }
- //DEL return TRUE;
- //DEL }
- CMatchList3::CMatchList3()
- {
- }
- CMatchList3::~CMatchList3()
- {
- ReInit();
- }
- void CMatchList3::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- void CMatchList3::Add(AD_OBJHANDLE handle,CString strlayeroutname,int iplotsheet) //添加到列表中
- {
- CMatch3* match=new CMatch3;
- memcpy(match->m_handle,handle,8);
- match->m_layeroutname=strlayeroutname;
- match->m_iplotsheet=iplotsheet;
- m_List.AddTail(match);
- }
- POSITION CMatchList3::GetHeadPosition()
- {
- return m_List.GetHeadPosition();
- }
- CMatch3* CMatchList3::GetNext(POSITION& pos)
- {
- return m_List.GetNext(pos);
- }
- BOOL CMatchList3::IsInList(AD_OBJHANDLE handle)
- {
- CMatch3* match;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match=m_List.GetNext(pos);
- if(match->m_handle[0]==handle[0])
- {
- if(match->m_handle[1]==handle[1])
- {
- if(match->m_handle[2]==handle[2])
- {
- if(match->m_handle[3]==handle[3])
- {
- if(match->m_handle[4]==handle[4])
- {
- if(match->m_handle[5]==handle[5])
- {
- if(match->m_handle[6]==handle[6])
- {
- if(match->m_handle[7]==handle[7])
- {
- return TRUE;
- }}}}}}}}
- }
- return FALSE;
- }
- CMatchList4::CMatchList4()
- {
- }
- CMatchList4::~CMatchList4()
- {
- ReInit();
- }
- void CMatchList4::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- void CMatchList4::Add(AD_OBJHANDLE handle,CMatch4* match) //添加到列表中
- {
- memcpy(match->m_handle,handle,8);
- m_List.AddTail(match);
- }
- BOOL CMatchList4::Get(AD_OBJHANDLE handle,CMatch4*& match)
- {
- CMatch4* match2;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match2=m_List.GetNext(pos);
- if(match2->m_handle[0]==handle[0])
- {
- if(match2->m_handle[1]==handle[1])
- {
- if(match2->m_handle[2]==handle[2])
- {
- if(match2->m_handle[3]==handle[3])
- {
- if(match2->m_handle[4]==handle[4])
- {
- if(match2->m_handle[5]==handle[5])
- {
- if(match2->m_handle[6]==handle[6])
- {
- if(match2->m_handle[7]==handle[7])
- {
- match=match2;
- return TRUE;
- }}}}}}}}
- }
- match=NULL;
- _WRITE(str.Format("*句柄%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- return FALSE;
- }
- CMatchList5::CMatchList5()
- {
- }
- CMatchList5::~CMatchList5()
- {
- ReInit();
- }
- void CMatchList5::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- CShape* CMatchList5::GetHead()
- {
- if(m_List.GetHeadPosition()!=NULL)
- {
- return m_List.GetHead()->m_shape;
- }
- return NULL;
- }
- void CMatchList5::Add(AD_OBJHANDLE handle,CShape* shape) //添加到列表中
- {
- static int d=0;d++;
- CWordStyle ws;
- CString strName;strName.Format("%s#CONV%d",shape->m_strShapename,d);
- ws.SetName(strName);
- CString strTemp;
- if(shape->m_bUseSHX){if(shape->m_strBigFontfilename.IsEmpty())shape->m_strBigFontfilename="bzdft.shx";ws.SetFontName(shape->m_strShapefilename + ';' + shape->m_strBigFontfilename );}
- else{ws.SetFontName( shape->m_strShapefilename);}
- if(shape->m_dShapeHeight==0)
- {
- ws.SetHeight(5);
- }
- else
- {
- ws.SetHeight(shape->m_dShapeHeight);
- }
- try
- {
- ws.SetWFactor(shape->m_dShapeWidth);
- }
- catch(...)
- {
- ws.SetWFactor(shape->m_dShapeWidth);
- }
- //ws.SetFlag(STEXT_WS);
- CKmDataManager* pDataManager=::GetActiveDataManager();
- if(pDataManager)
- {
- CString strTemp;
- int index=0;
- ws.SetID(0);
- while((shape->m_KmWordStyleID=pDataManager->AddWordStyle(ws,TRUE))==0)
- {
- index++;
- strTemp.Format("%s#%d",strName,index);
- ws.SetName(strTemp);
- }
- }
- CMatch5* match=new CMatch5;
- memcpy(match->m_handle,handle,8);
- match->m_shape=shape;
- m_List.AddTail(match);
- }
- BOOL CMatchList5::Get(AD_OBJHANDLE handle,CMatch5*& match)
- {
- CMatch5* match2;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match2=m_List.GetNext(pos);
- if(match2->m_handle[0]==handle[0])
- {
- if(match2->m_handle[1]==handle[1])
- {
- if(match2->m_handle[2]==handle[2])
- {
- if(match2->m_handle[3]==handle[3])
- {
- if(match2->m_handle[4]==handle[4])
- {
- if(match2->m_handle[5]==handle[5])
- {
- if(match2->m_handle[6]==handle[6])
- {
- if(match2->m_handle[7]==handle[7])
- {
- match=match2;
- return TRUE;
- }}}}}}}}
- }
- _WRITE(str.Format("*形文件%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- return FALSE;
- }
- CShape* CMatchList5::Get(UINT kmid)
- {
- CMatch5* match2;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match2=m_List.GetNext(pos);
- if(match2->m_shape->m_KmWordStyleID==kmid)
- {
- return match2->m_shape;
- }
- }
- _WRITE(str.Format("*形文件%d没有在匹配链表中找到匹配项",kmid));
- return NULL;
- }
- //DEL void CMatchList5::processentity(CKmgConverter* pConverter,AD_OBJHANDLE handle,int index,
- //DEL double x0,double y0,double z0,double scale,double lean ,double retota,double widthscale)
- //DEL {
- //DEL CMatch5* match=NULL;
- //DEL CMatch5* match2;
- //DEL
- //DEL POSITION pos=m_List.GetHeadPosition();
- //DEL while(pos)
- //DEL {
- //DEL match2=m_List.GetNext(pos);
- //DEL if(match2->m_handle[0]==handle[0])
- //DEL {
- //DEL if(match2->m_handle[1]==handle[1])
- //DEL {
- //DEL if(match2->m_handle[2]==handle[2])
- //DEL {
- //DEL if(match2->m_handle[3]==handle[3])
- //DEL {
- //DEL if(match2->m_handle[4]==handle[4])
- //DEL {
- //DEL if(match2->m_handle[5]==handle[5])
- //DEL {
- //DEL if(match2->m_handle[6]==handle[6])
- //DEL {
- //DEL if(match2->m_handle[7]==handle[7])
- //DEL {
- //DEL match=match2;
- //DEL break;
- //DEL }}}}}}}}
- //DEL }
- //DEL if(match==NULL)
- //DEL {
- //DEL _WRITE(str.Format("*形文件%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- //DEL return ;
- //DEL }
- //DEL if(match->m_shapes.GetSize()<index)
- //DEL {
- //DEL _WRITE(str.Format("*形文件%x%x%x%x%x%x%x%x中没有第%d号形",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7],index));
- //DEL return ;
- //DEL }
- //DEL KmObject* pObj;
- //DEL KmObject* pCopy;
- //DEL pos=match->m_shapes[index-1]->m_objs.GetHeadPosition();
- //DEL while(pos!=NULL)
- //DEL {
- //DEL pObj=match->m_shapes[index-1]->m_objs.GetNext(pos);
- //DEL pCopy=(KmObject*)pObj->GetRuntimeClass()->CreateObject();
- //DEL pCopy->Copy(pObj);
- //DEL pConverter->ConverterEntiey_KmObject(pCopy);
- //DEL }
- //DEL return ;
- //DEL }
- CMatchList6::CMatchList6()
- {
- }
- CMatchList6::~CMatchList6()
- {
- ReInit();
- }
- void CMatchList6::ReInit()
- {
- POSITION posCur;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- posCur=pos;
- delete m_List.GetNext(pos);
- m_List.RemoveAt(posCur);
- }
- }
- void CMatchList6::Add(AD_OBJHANDLE handle,CString strDicdflt) //添加到列表中
- {
- CMatch6* match=new CMatch6;
- memcpy(match->m_handle,handle,8);
- match->m_strDicdflt=strDicdflt;
- m_List.AddTail(match);
- }
- BOOL CMatchList6::Get(AD_OBJHANDLE handle,CString& strDicdflt)
- {
- CMatch6* match2;
- POSITION pos=m_List.GetHeadPosition();
- while(pos)
- {
- match2=m_List.GetNext(pos);
- if(match2->m_handle[0]==handle[0])
- {
- if(match2->m_handle[1]==handle[1])
- {
- if(match2->m_handle[2]==handle[2])
- {
- if(match2->m_handle[3]==handle[3])
- {
- if(match2->m_handle[4]==handle[4])
- {
- if(match2->m_handle[5]==handle[5])
- {
- if(match2->m_handle[6]==handle[6])
- {
- if(match2->m_handle[7]==handle[7])
- {
- strDicdflt=match2->m_strDicdflt;
- return TRUE;
- }}}}}}}}
- }
- _WRITE(str.Format("*形文件%x%x%x%x%x%x%x%x没有在匹配链表中找到匹配项",handle[0],handle[1],handle[2],handle[3],handle[4],handle[5],handle[6],handle[7]));
- return FALSE;
- }