Click here to Skip to main content
15,904,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Selection in CListCtrl Pin
Joaquín M López Muñoz29-Oct-02 10:03
Joaquín M López Muñoz29-Oct-02 10:03 
GeneralRe: Selection in CListCtrl Pin
Le centriste29-Oct-02 10:20
Le centriste29-Oct-02 10:20 
GeneralSimple/Dumb Question! Pin
Anonymous29-Oct-02 9:13
Anonymous29-Oct-02 9:13 
GeneralRe: Simple/Dumb Question! Pin
User 665829-Oct-02 9:15
User 665829-Oct-02 9:15 
GeneralRe: Simple/Dumb Question! Pin
Anonymous29-Oct-02 22:17
Anonymous29-Oct-02 22:17 
GeneralRe: Simple/Dumb Question! Pin
User 665830-Oct-02 1:56
User 665830-Oct-02 1:56 
GeneralRe: Simple/Dumb Question! Pin
Anonymous30-Oct-02 23:21
Anonymous30-Oct-02 23:21 
GeneralRe: Simple/Dumb Question! Pin
Michael P Butler29-Oct-02 9:26
Michael P Butler29-Oct-02 9:26 
GeneralRe: Simple/Dumb Question! Pin
Navin29-Oct-02 10:53
Navin29-Oct-02 10:53 
GeneralBOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Happy_Dog29-Oct-02 8:06
Happy_Dog29-Oct-02 8:06 
GeneralRe: BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Ravi Bhavnani29-Oct-02 8:13
professionalRavi Bhavnani29-Oct-02 8:13 
GeneralRe: BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Joaquín M López Muñoz29-Oct-02 8:13
Joaquín M López Muñoz29-Oct-02 8:13 
GeneralRe: BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) Pin
Happy_Dog29-Oct-02 10:09
Happy_Dog29-Oct-02 10:09 
QuestionHow do i get the path of my program? Pin
Anonymous29-Oct-02 7:27
Anonymous29-Oct-02 7:27 
AnswerRe: How do i get the path of my program? Pin
Happy_Dog29-Oct-02 7:43
Happy_Dog29-Oct-02 7:43 
QuestionDraw a rubberband? Pin
Anonymous29-Oct-02 6:49
Anonymous29-Oct-02 6:49 
GeneralFocused Based Transparency Question Pin
John Aldrich29-Oct-02 6:34
John Aldrich29-Oct-02 6:34 
GeneralRe: Focused Based Transparency Question Pin
Ravi Bhavnani29-Oct-02 7:21
professionalRavi Bhavnani29-Oct-02 7:21 
QuestionText To Speech SDK 5.0 ? Pin
Member 159223629-Oct-02 6:28
Member 159223629-Oct-02 6:28 
Generalcreating a mapped drive Pin
Tom Wright29-Oct-02 5:59
Tom Wright29-Oct-02 5:59 
GeneralTCP/IP questions Pin
Tom Wright29-Oct-02 5:52
Tom Wright29-Oct-02 5:52 
GeneralRe: TCP/IP questions Pin
Anonymous29-Oct-02 6:52
Anonymous29-Oct-02 6:52 
GeneralRe: TCP/IP questions Pin
User 988529-Oct-02 6:52
User 988529-Oct-02 6:52 
GeneralRichEdit Text Color (win32api) Pin
zeki yugnak29-Oct-02 5:51
zeki yugnak29-Oct-02 5:51 
QuestionHow to insert data to the top of exist text file? Pin
ooosawaddee329-Oct-02 5:40
ooosawaddee329-Oct-02 5:40 
I want to insert "{" to the top of exist text file and insert "}" to the bottom of text file

Example:

If in "1.txt" has this data in it.

1234afd
daf845
dfdfa

and I want to insert "{" to the top of text file and insert "}" to the bottom of text file. So I think it should be like this

{
1234afd
daf845
dfdfa
}

I write program to do that. But my program replace "{" to the first line data of "1.txt"

So my program write this data in "1.txt"

{
daf845
dfdfa
}

Below is my program.

<br />
CStdioFile OutputFile;<br />
CString outp_filename, m_string; <br />
CFileException FileExc;<br />
BOOL bEnd;<br />
<br />
	outp_filename = "1.txt";<br />
<br />
if (!OutputFile.Open(outp_filename, CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate, &FileExc)) <br />
{<br />
FileExc.ReportError();<br />
return;<br />
}<br />
OutputFile.SeekToBegin();<br />
<br />
m_string = "{";<br />
<br />
OutputFile.WriteString(m_string+'\n'); <br />
<br />
OutputFile.SeekToEnd();<br />
<br />
m_string = "}";<br />
<br />
OutputFile.WriteString(m_string+'\n');<br />
<br />
OutputFile.Close();<br />
<br />
}<br />
<br />


Do you know how to solve my problem?
Thank you very much.

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.