Beispiel #1
0
int CContentCtrl::GetContent(CBinaryData& content) const
{
	int nLenBytes = 0;
	content.Empty();
	
	if (m_pContentCtrl)
	{
		nLenBytes = m_pContentCtrl->GetContent(NULL);
		
		if (nLenBytes) // excludes NULL
		{
			unsigned char* szContent = content.GetBuffer(nLenBytes);
			nLenBytes = m_pContentCtrl->GetContent(szContent);
			content.ReleaseBuffer(nLenBytes);
		}
	}
	
	return nLenBytes;
}
Beispiel #2
0
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);
}
Beispiel #3
0
BOOL CContentCtrl::SetContent(const CBinaryData& content, BOOL bResetSelection)
{
	return SetContent(content.Get(), content.GetLength(), bResetSelection);
}