|
Hi,
Its a wrong way!
you can use 'cin'(getting strings) or 'get'(getting characters) or 'getline'(get a whole line) funcs to get some text, and then 'cout' them. there is more options for these funcs (see MSDN).
|
|
|
|
|
zoobiskuit wrote: ofstream myStringErrors( "Lab1.txt" ); // Default is ios::out
If the default is ios::out , wouldn't it make more sense to use ios::in instead?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
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.
ralf.riedel@usm.edu
|
|
|
|
|
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...
|
|
|
|
|
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.
ralf.riedel@usm.edu
|
|
|
|
|
you have to use CWnd::GetWindowText() on the control you wan't to get the text from
|
|
|
|
|
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.
ralf.riedel@usm.edu
|
|
|
|
|
You can use of GetWindowText or WM_GETTEXT
|
|
|
|
|
hi guys
how do i set the cursor on Cstatic control
thanks
|
|
|
|
|
CStatic is not editable (by the user of the UI), so no cursor can be set on it
|
|
|
|
|
Use a read only edit control with no borders instead.
Steve
|
|
|
|
|
thanks, by the way how do i find cursor position outside of window?
thanks
|
|
|
|
|
I believe you use the CEdit::GetSel function(s).
Steve
|
|
|
|
|
Is your purpose GetCursorpos ?
|
|
|
|
|
Is there someone out there who knows where to get Visual c++ 1.52 ?
|
|
|
|
|
Have you searched eBay, Amazon, and other Goggle-able sites?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Another option is to find an old copy of MSDN. I don't remember when they stopped including it, but I think it was still there in the 2002 time frame.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I may have a that version --- I think it's the 16-bit version? But I'm not at home to check and see if I still have it. If you'll send me an email at "jepark@yahoo.com" to remind me, I'll check to see if I still have my CD and let you know.
John P.
|
|
|
|
|
The obvious question no one seems to have asked is: why do you want such an old version?
Steve
|
|
|
|
|
I didn't think twice about him using that version. Compilers are governed by a lot of factors, not the least of which is the target OS. The last company I worked for used that version exclusively, and then jumped straight to Web enablement, skipping past any 32-bit development.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I need that version to interface with an old Cobol program that only works with a 16 bit object. I managed to find it at a sit that specializes in "abandoned software".
|
|
|
|
|
I am searching for a method to disable certain topics in the standard MSOffice menues, especially the "Save as" feature in the file menue of MSword or MSExcel, when starting these programs from a C++ program.
peter
|
|
|
|
|
Hi....I seem to have run into an issue with property pages under release mode (works fine in debug) and not really sure what is going on. Any pointers would be greatly apperciated
Debug Assertion Failed in 'dlgprop.cpp' the call stack seems to be pointing to the 'ASSERT' line in AddPage function
void CPropertySheet::AddPage(CPropertyPage* pPage)
{
..
..
..
ASSERT_KINDOF(CPropertyPage, pPage);
..
..
..
}
<br />
<br />
<br />
CPage1* m_Page1;<br />
CPage2* m_Page2;<br />
CPage3* m_Page3;<br />
<br />
<br />
<br />
m_Page1 = new CPage1(this);<br />
m_Page2 = new CPage2(this);<br />
m_Page3 = new CPage3(this);<br />
<br />
AddPage(m_Page1); <<- SEEMS TO FAIL HERE----<br />
AddPage(m_Page2);<br />
AddPage(m_Page3);<br />
<br />
SetWizardMode();<br />
|
|
|
|