BOOL CContentMgr::ConvertContentToHtml(const CBinaryData& content, CString& sHtml, LPCTSTR szID, LPCTSTR szCharSet, LPCTSTR szImageDir) { Initialize(); // initialize on demand int nContent = FindContent(szID); if (nContent == -1) return FALSE; IContent* pContent = m_aContent[nContent]; ASSERT (pContent); LPTSTR szHtml = NULL; int nHtmlLen = pContent->ConvertToHtml(content.Get(), content.GetLength(), szCharSet, szHtml, szImageDir); if (nHtmlLen) sHtml = szHtml; pContent->FreeHtmlBuffer(szHtml); // cleanup return (nHtmlLen > 0); }
BOOL CContentCtrl::SetContent(const CBinaryData& content, BOOL bResetSelection) { return SetContent(content.Get(), content.GetLength(), bResetSelection); }