this is kinda off in left field but....

Started by
2 comments, last by khalligan 19 years, 5 months ago
I know this is kind of an odd request, but i'm not sure where to look for this answer. I'm working on a tool using MFC trying to create a script engine. How do i get the text from the Document? I've been looking through MSDN, but have been unable to find much results. I don't care about formatting blah blah (thanks to MSDN for paragraphs about these things I don't need) i just need a stupid char*. I'd even settle for a CString, ATL::CStringT ATL::CSimpleString or whatever they use. thanks for any help as always
~guyaton
Advertisement
are you just trying to read txt from a file? this seems kinda basic for someone trying to write a scripting engine... if you are just tryinig to read txt from a file, let us know, resources are abundant... otherwise, make your question more distinct.
Reading and writing from a text file is not the problem. I used MS Visual Studio .NET (2002) to create an MFC app that used Rich Edit controls (ex. inherits CRichEditDoc, CRichEditView...etc). If someone writes say 50 lines of this script code, how do i get just the text, without having to worry about the format the text is in? Do I have to get it line by line? or can i get the whole block as one lump sum?

~guyaton
You could try getting a CWnd* pointer to the control and then use GetWindowText()...

That should work, you may also need to use GetDocument() to reference whatever data you have in your document.

Hope this helps.

Keith

This topic is closed to new replies.

Advertisement