reading text into CString
-
Hallo all, can anyone tell me how to read in a line of text into a CString variable in and MDI MFC appln? All I want to do is to parse a text line-by-line from the active child window into the variable. I have a very simple text editor where the view is inherited from CEditView. thx, Ralf.
-
Hallo all, can anyone tell me how to read in a line of text into a CString variable in and MDI MFC appln? All I want to do is to parse a text line-by-line from the active child window into the variable. I have a very simple text editor where the view is inherited from CEditView. thx, Ralf.
use CString::Find() to search the next '\n' character, and use CString::Mid() to extract the portion between the previous Find() result and the new one...
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
Hallo all, can anyone tell me how to read in a line of text into a CString variable in and MDI MFC appln? All I want to do is to parse a text line-by-line from the active child window into the variable. I have a very simple text editor where the view is inherited from CEditView. thx, Ralf.
You can do it bye using the recursive call of CString::Find() for "\r\n" then use the CString::Mid. The appropriate use of of the above given method will help you to get the expected result.
The secret of life is not enjoyment but education through experience. - Swami Vivekananda.
-
You can do it bye using the recursive call of CString::Find() for "\r\n" then use the CString::Mid. The appropriate use of of the above given method will help you to get the expected result.
The secret of life is not enjoyment but education through experience. - Swami Vivekananda.
can you tell me in what is your reply different from mine ?! :confused::~ moreover, please edit the HTML in your name, you're breaking the pages formatting[^] :suss:
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
can you tell me in what is your reply different from mine ?! :confused::~ moreover, please edit the HTML in your name, you're breaking the pages formatting[^] :suss:
Don't know where to start ?
Refer the Forums Guidelines and ask a friendActually, my question is not that one. Sorry about the confusion. I was asking how to capture a string from the active child. I think I'd have to have a pointer to that child and somehow read its contents. Once I have that taken care of, then yes, I'd use CString's methods. Thx, Ralf.
-
You can do it bye using the recursive call of CString::Find() for "\r\n" then use the CString::Mid. The appropriate use of of the above given method will help you to get the expected result.
The secret of life is not enjoyment but education through experience. - Swami Vivekananda.
Actually, my question is not that one. Sorry about the confusion. I was asking how to capture a string from the active child. I think I'd have to have a pointer to that child and somehow read its contents. Once I have that taken care of, then yes, I'd use CString's methods. Thx, Ralf.
-
Actually, my question is not that one. Sorry about the confusion. I was asking how to capture a string from the active child. I think I'd have to have a pointer to that child and somehow read its contents. Once I have that taken care of, then yes, I'd use CString's methods. Thx, Ralf.
you have to use
CWnd::GetWindowText()
on the control you wan't to get the text from
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
Actually, my question is not that one. Sorry about the confusion. I was asking how to capture a string from the active child. I think I'd have to have a pointer to that child and somehow read its contents. Once I have that taken care of, then yes, I'd use CString's methods. Thx, Ralf.
You can use of
GetWindowText
orWM_GETTEXT
WhiteSky