Ejemplo n.º 1
0
void CmdwEditorDoc::Serialize(CArchive& ar)
{
	POSITION pos = this->GetFirstViewPosition();
	CView* cv = NULL;
	CEditView* pEv = NULL;
	
	do {
		cv = this->GetNextView(pos);
		if( cv != NULL && cv->IsKindOf(RUNTIME_CLASS(CEditView))) {
			pEv = (CEditView*)cv;  
			break;
		}
	} while(cv != NULL);

	if(pEv == NULL) return;

	//CString htmlpath;
	CFile *pCF = ar.GetFile();
	//if(pCF != NULL)
	//	htmlpath = pCF->GetFilePath() + _T(".html");

	if (ar.IsStoring())
	{
		// TODO: add storing code here
		/**
			unicode data 修改後儲存時轉換回 utf-8
			再由sundown 轉換成 html,通知 HtmlView 顯示
		*/
		LPCTSTR lpszText = pEv->LockBuffer();
		ASSERT(lpszText != NULL);
		UINT nLen = pEv->GetBufferLength();
		TRY
		{
			//ar.Write(lpszText, nLen*sizeof(TCHAR));
			getEditText(lpszText, nLen);

			pCF->SeekToBegin();
			pCF->Write(mib_utf8->data, mib_utf8->size);

			m_bHtmlExisted = convMd2Html((LPCTSTR)m_htmlPath, m_cssPath);
			this->UpdateAllViews(NULL, (LPARAM)(LPCTSTR)m_htmlPath, NULL);
		}
		CATCH_ALL(e)
		{
			pEv->UnlockBuffer();
			THROW_LAST();
		}
		END_CATCH_ALL

		pEv->UnlockBuffer();
	}
Ejemplo n.º 2
0
char *
OPL_LoginDialog::GetPWD()
{
    return OPL_CFString_to_char(getEditText(kLoginPwd));
}
Ejemplo n.º 3
0
char *
OPL_LoginDialog::GetDSN()
{
    return OPL_CFString_to_char(getEditText(kLoginDSN));
}