YesStout
April 9th, 1999, 09:18 PM
I'm building an HTML Editor (MFC Appwizard) and I've created a dialog to
insert hyperlinks.The dialog contains 2 edit boxes IDC_HYP_EDIT
(m_hyp/member variable) andIDC_TEXT_EDIT (m_text/member variable)
The idea here is you type the URL into the first edit box and the text
you want displayed into the second edit box,you then push the insert button (IDOK) and this inserts the link into the HTML code. The problem is that I
can't seem to figure out how to insert the text from the edit boxes into the
client area (MDI Child Window)this is the code that I am using:
void CGoldenFlashHTMLEditorView::OnOpenHyplink()
{
CHypLinkDialog HLdlg;
if (HLdlg.DoModal() ==IDOK)
{
CString m_hyp;
CString m_text;
GetEditCtrl().ReplaceSel("<A HREF=");
GetEditCtrl().ReplaceSel(m_hyp);
GetEditCtrl().ReplaceSel(">");
GetEditCtrl().ReplaceSel(m_text);
GetEditCtrl().ReplaceSel("</A>");
}
}
Any body know what is wrong or missing? There are no build errors it just inserts everything except the text from the edit boxes.
insert hyperlinks.The dialog contains 2 edit boxes IDC_HYP_EDIT
(m_hyp/member variable) andIDC_TEXT_EDIT (m_text/member variable)
The idea here is you type the URL into the first edit box and the text
you want displayed into the second edit box,you then push the insert button (IDOK) and this inserts the link into the HTML code. The problem is that I
can't seem to figure out how to insert the text from the edit boxes into the
client area (MDI Child Window)this is the code that I am using:
void CGoldenFlashHTMLEditorView::OnOpenHyplink()
{
CHypLinkDialog HLdlg;
if (HLdlg.DoModal() ==IDOK)
{
CString m_hyp;
CString m_text;
GetEditCtrl().ReplaceSel("<A HREF=");
GetEditCtrl().ReplaceSel(m_hyp);
GetEditCtrl().ReplaceSel(">");
GetEditCtrl().ReplaceSel(m_text);
GetEditCtrl().ReplaceSel("</A>");
}
}
Any body know what is wrong or missing? There are no build errors it just inserts everything except the text from the edit boxes.