void CAoEx1View::OnAddcad()
{
CString strFilter;
strFilter = "Auto CAD(*.dxf)| *.dxf|Auto CAD(*.dwg)|*.dwg||";
CFileDialog pDlg(TRUE,NULL,NULL,
OFN_ALLOWMULTISELECT|OFN_EXPLORER|OFN_LONGNAMES|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,
(LPCTSTR)strFilter,
NULL);
CString strTitle =L"select CAD file";
pDlg.m_ofn.lpstrTitle = strTitle;
if(IDCANCEL ==pDlg.DoModal()) return;
CString strExt,strPath;
strExt = pDlg.GetFileExt();
strPath = pDlg.GetPathName();
if(!(strExt.IsEmpty()))
{
int temp;
temp = strPath.ReverseFind('//');
strPath = strPath.Left(temp);
}
IWorkspaceFactoryPtr ipCadWKSFact(CLSID_CadWorkspaceFactory);
IWorkspacePtr ipwspace;
HRESULT hr = ipCadWKSFact->OpenFromFile((_bstr_t)strPath,NULL,&ipwsp