Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Ultimate Grid in an ActiveX - TOOL TIPS not working.... Pin
Chetan Sheladiya12-Apr-11 2:46
professionalChetan Sheladiya12-Apr-11 2:46 
QuestionTreeview selected item background [Solved] Pin
Rozis27-Jul-09 10:03
Rozis27-Jul-09 10:03 
AnswerRe: Treeview selected item background Pin
Code-o-mat27-Jul-09 11:44
Code-o-mat27-Jul-09 11:44 
GeneralRe: Treeview selected item background Pin
Rozis28-Jul-09 0:02
Rozis28-Jul-09 0:02 
QuestionHow to fill PDF's fields? Pin
Hadi Dayvary27-Jul-09 8:27
professionalHadi Dayvary27-Jul-09 8:27 
AnswerRe: How to fill PDF's fields? Pin
Adam Roderick J27-Jul-09 18:34
Adam Roderick J27-Jul-09 18:34 
QuestionGetting string from a Text file Pin
dipuks27-Jul-09 7:30
dipuks27-Jul-09 7:30 
AnswerRe: Getting string from a Text file Pin
Rajesh R Subramanian27-Jul-09 7:51
professionalRajesh R Subramanian27-Jul-09 7:51 
If you're using MFC, you can use CStdioFile or CFile. With Win32, you could use ReadFile() or use the C++ stream functions as well. I'm picking the easiest and showing you an example:

CStdioFile csf;
CFileException cfe;
if(!csf.Open(_T("C:\\Temp\\rough.txt"), CFile::modeRead, &cfe))
{
	AfxMessageBox(_T("Unable to open the file"));
	return;
}
CString szBuffer;
csf.ReadString(szBuffer);
int nFind = szBuffer.Find(_T("="));
AfxMessageBox(szBuffer.Mid(nFind+1)); //Will display 23

Contents of file:
age = 23



It is a crappy thing, but it's life -^ Carlo Pallini

QuestionCToolBarCtrl::GetToolBarCtrl(); Pin
Software200727-Jul-09 7:21
Software200727-Jul-09 7:21 
AnswerRe: CToolBarCtrl::GetToolBarCtrl(); Pin
znasir16-Dec-12 23:20
znasir16-Dec-12 23:20 
QuestionWant to know about mouse programming Pin
WindowsVsLinux27-Jul-09 6:44
WindowsVsLinux27-Jul-09 6:44 
AnswerRe: Want to know about mouse programming Pin
Rozis27-Jul-09 10:06
Rozis27-Jul-09 10:06 
GeneralRe: Want to know about mouse programming Pin
WindowsVsLinux27-Jul-09 19:33
WindowsVsLinux27-Jul-09 19:33 
QuestionWill this work in C++ (Vector, Struct) Pin
resolvequestion27-Jul-09 6:40
resolvequestion27-Jul-09 6:40 
AnswerRe: Will this work in C++ (Vector, Struct) Pin
Chris Losinger27-Jul-09 9:10
professionalChris Losinger27-Jul-09 9:10 
Questionpolynomial addition with array using C++ Pin
beulahponmalar27-Jul-09 6:29
beulahponmalar27-Jul-09 6:29 
AnswerRe: polynomial addition with array using C++ Pin
Maximilien27-Jul-09 6:37
Maximilien27-Jul-09 6:37 
QuestionNotify Events When Event log is Full Pin
Raghu.Amil27-Jul-09 5:59
Raghu.Amil27-Jul-09 5:59 
AnswerRe: Notify Events When Event log is Full Pin
David Crow27-Jul-09 6:04
David Crow27-Jul-09 6:04 
QuestionDistribute application across network Pin
vikrant kpr27-Jul-09 5:10
vikrant kpr27-Jul-09 5:10 
QuestionBit of an odd one, vssver2, time_t and DWORD Pin
J4amieC27-Jul-09 4:43
J4amieC27-Jul-09 4:43 
AnswerRe: Bit of an odd one, vssver2, time_t and DWORD Pin
Rajesh R Subramanian27-Jul-09 7:11
professionalRajesh R Subramanian27-Jul-09 7:11 
GeneralRe: Bit of an odd one, vssver2, time_t and DWORD Pin
J4amieC27-Jul-09 23:02
J4amieC27-Jul-09 23:02 
GeneralRe: Bit of an odd one, vssver2, time_t and DWORD Pin
Rajesh R Subramanian28-Jul-09 5:36
professionalRajesh R Subramanian28-Jul-09 5:36 
QuestionHow to disable the Comport Error dialog? Pin
THAQCD27-Jul-09 4:05
THAQCD27-Jul-09 4:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.