thanks. this query is resolves. it is not relate com, it is other question.
sdfdsfsd
thanks. this query is resolves. it is not relate com, it is other question.
sdfdsfsd
CPtrList is not in c++, it is in vc++
sdfdsfsd
The following code is correct: FRLE_FALSE(m_pRssManager.CreateInstance(RssLib::CLSID_RssManager),_T("can't create RssManager object")); CString sRssDBFile = (LPCTSTR)(GlobalSet::g_sRootPath + _T("\\DB\\RssTab.mrr")); try{ m_pRssManager->Open((LPCTSTR)sRssDBFile); } catch(...) { MessageBox(::AfxGetMainWnd()->m_hWnd, _T("database file is already damaged,will create a new empty database file"),_T("message"),MB_OK|MB_ICONINFORMATION); CString sRssDBTemplateFile = (LPCTSTR)(GlobalSet::g_sRootPath + _T("\\NewRssTab.mrr")); if( ::PathFileExists(sRssDBTemplateFile) ){ ::CopyFile(sRssDBTemplateFile, sRssDBFile, FALSE); RssLib::IRssManagerPtr pRssManager; FRLE_FALSE(pRssManager.CreateInstance(RssLib::CLSID_RssManager),_T("can't create RssManager object")); pRssManager->Open((LPCTSTR)sRssDBFile); m_pRssManager = pRssManager; } } the following code is not correct: FRLE_FALSE(m_pRssManager.CreateInstance(RssLib::CLSID_RssManager),_T("can't create RssManager object")); CString sRssDBFile = (LPCTSTR)(GlobalSet::g_sRootPath + _T("\\DB\\RssTab.mrr")); try{ m_pRssManager->Open((LPCTSTR)sRssDBFile); } catch(...) { MessageBox(::AfxGetMainWnd()->m_hWnd, _T("database file is already damaged,will create a new empty database file"),_T("message"),MB_OK|MB_ICONINFORMATION); CString sRssDBTemplateFile = (LPCTSTR)(GlobalSet::g_sRootPath + _T("\\NewRssTab.mrr")); if( ::PathFileExists(sRssDBTemplateFile) ){ ::CopyFile(sRssDBTemplateFile, sRssDBFile, FALSE); m_pRssManager ->Open((LPCTSTR)sRssDBFile); } } May I ask the reason ? Why have to recreate the RssManager object ? thanks a lot!
sdfdsfsd