Need to Set text from Dialog CEdit to Active Window in MDI text app 
Author Message
 Need to Set text from Dialog CEdit to Active Window in MDI text app

Yup.. Another NEWBIE Question!

I've been forced to pick up MFC (in a hurry using VC++4.0). I've created an
MDI text editor using the wizard, and have numerous dialogs in which the
user enters text into a CEdit control, the text (CString) then gets modified
(strcpy & strcat) and must be inserted into the active window. I'm able to
get the modified text to the clipboard and manually paste it or send it to a
messagebox. Everything else in the app works fine , but after trying
everything, I am unable to insert the text into the open document. Any help
would be GREATLY appreciated!!

Does the "F" in MFC stand for FRUSTRATION :-)

Vince



Thu, 31 May 2001 03:00:00 GMT  
 Need to Set text from Dialog CEdit to Active Window in MDI text app
Clements:

Not quite sure what you're asking, but if you are using modal dialogs, the
standard sequence is:

CMyDialog dlg;
dlg.m_string=m_string;
if (dlg.DoModal == IDOK)
{
  m_string=dlg.m_string;

Quote:
}

The variable m_string is now available in whatever module this piece of code is
in. If m_string is actually part of the document data, then I find it more
convenient to place this code in the document; if you put it in the view, then
you will have to further pass the data back to the document using something like

CMyDoc* pDoc = (CMyDoc*)GetDocument();
pDoc->m_string=m_string;
pDoc->UpdateAllViews();

HTH,

David Wilkinson

=============

Quote:

> Yup.. Another NEWBIE Question!

> I've been forced to pick up MFC (in a hurry using VC++4.0). I've created an
> MDI text editor using the wizard, and have numerous dialogs in which the
> user enters text into a CEdit control, the text (CString) then gets modified
> (strcpy & strcat) and must be inserted into the active window. I'm able to
> get the modified text to the clipboard and manually paste it or send it to a
> messagebox. Everything else in the app works fine , but after trying
> everything, I am unable to insert the text into the open document. Any help
> would be GREATLY appreciated!!

> Does the "F" in MFC stand for FRUSTRATION :-)

> Vince



Thu, 31 May 2001 03:00:00 GMT  
 Need to Set text from Dialog CEdit to Active Window in MDI text app
You may have tried this? I find to set the text in a window you can use the
following.

SetWindowText( "xyz" );

Be sure call it for the correct control.

Advertisers using spambots, please don't send to the following addresses:






























Fri, 01 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting CEdit Text in Modal Dialog

2. how can i set an MDI Child window active

3. Geting Active Window Handle of an MDI app

4. Getting Active Window in an MDI App

5. Setting Text in CEdit with SetWindowText()

6. Setting text in CEdit ctrl

7. Setting text and background color in CEdit

8. How to set text into CEdit (Multiline)

9. multiple-line CEdit set multi-line text

10. How to set text in CEdit

11. How to set multiline text in a CEdit?

12. How to set text in CEdit

 

 
Powered by phpBB® Forum Software