-
June 9th, 2009, 01:37 PM
#1
CEditView or CRichEditView Class
Hello All.
I need some advice about using one or the other of the above mentioned classes. What I need is to display messages inside of a CEditView object of the users session with a FTPClient application that I am writing. So essentially I want to keep track of the users interaction with the program.
However what I needed to know is it possible to use the CEditView or CRichEditView class to make the window background all white and not shaded which right now its a taint of grey/beige (using CEditview) in my case.
So which of these two classes will accomplish with what I am asking or is it one of the two will do the trick.
Thanks in advance.
-
June 9th, 2009, 04:38 PM
#2
Re: CEditView or CRichEditView Class
EditView should be wite unless you set it to read only I believe.
-
June 10th, 2009, 11:03 AM
#3
Re: CEditView or CRichEditView Class
Thanks for the reply. I have decided to go with CEditView but was wondering if anyone knows how to disable the confirmation of Saving the changed/modified document once I have added items to the View ? Another words when I close out the application I get a "Save changes to Untitled ?" I imagine that it has something to adding text lines to the CEditView. I have also chosen for the document to be ReadOnly.
Any suggestions would be kindly appreciated.
-
June 10th, 2009, 12:43 PM
#4
Re: CEditView or CRichEditView Class
I did find a solution via google.com from someone else who was having the exact same issue. However it still does not work for me. In that I get prompted to save the document.
Here is the code I found here and the results of the implementation
http://www.eggheadcafe.com/software/...x-in-cedi.aspx
Code:
void CMainFrame::OnClose()
{
CEdit * editCtrl = (CEdit*)CWnd::FromHandle(m_hndLogView);
if(editCtrl->GetModify()) // returns TRUE
editCtrl->SetModify(FALSE);
BOOL val = editCtrl->GetModify(); // returns FALSE
CFrameWnd::OnClose();}
Last edited by justmehere; June 10th, 2009 at 12:50 PM.
-
June 11th, 2009, 11:13 AM
#5
Re: CEditView or CRichEditView Class
I thought I would post the solution that does work. I was able to find the solution on another developer forum. Here is the working solution.
Code:
void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
if(GetActiveFrame())
{
CView* pView = GetActiveFrame()->GetActiveView();
if(pView)
{
CDocument* pDoc = pView->GetDocument();
if(pDoc)
pDoc->SetModifiedFlag(FALSE);
}
}
CMDIFrameWnd::OnClose();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|