Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3044

Text editor in vc++

$
0
0
Hi everyone!
I need to "send" data in a notepad every time I write double numbers on edit control and press save. I wrote some code but my dialog (where the edit control is) don't even open when I run the executable. What I've done so far:
Code:

void CDataDialog::OnBnClickedSave()
{
        // TODO: Add your control notification handler code here
        CFileDialog dlg(FALSE, L"Text Files (*.txt)|*.txt|Texr Files (*.h)|*.h|", NULL, OFN_OVERWRITEPROMPT, L"Text Files (*.txt)|*.txt|Text Files (*.h)|*.h|");

        CStdioFile file;

        CString buffer;
        CString textfile;

        if (dlg.DoModal() == IDOK)
        {
                file.Open(dlg.GetFileName(), CStdioFile::modeCreate | CStdioFile::modeWrite);
                dlg.GetFileName();

                file.WriteString(buffer);

                file.Close();
        }

}

Code:

void CDataDialog::OnEnChangeEdit1()
{
        // TODO:  If this is a RICHEDIT control, the control will not
        // send this notification unless you override the CDialog::OnInitDialog()
        // function and call CRichEditCtrl().SetEventMask()
        // with the ENM_CHANGE flag ORed into the mask.

        // TODO:  Add your control notification handler code here
        UpdateData(TRUE);
}

I think I must write some code here so the dialog box work fine but I can't it.:

Code:

void CInputView::OnLinefeaturesData()
{
        // TODO: Add your command handler code here
        CInputDoc* pDoc = GetDocument();
        CDataDialog DialogWindow;
}


Viewing all articles
Browse latest Browse all 3044

Trending Articles