Click here to Skip to main content
15,902,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Handling a process termination. Pin
kawayi30-Apr-10 6:31
kawayi30-Apr-10 6:31 
AnswerRe: Handling a process termination. Pin
«_Superman_»30-Apr-10 6:54
professional«_Superman_»30-Apr-10 6:54 
QuestionSub menu Item Check and uncheck in Win 32 Pin
arun_pk29-Apr-10 19:56
arun_pk29-Apr-10 19:56 
AnswerRe: Sub menu Item Check and uncheck in Win 32 Pin
PrafullaShirke2729-Apr-10 21:24
professionalPrafullaShirke2729-Apr-10 21:24 
GeneralRe: Sub menu Item Check and uncheck in Win 32 Pin
arun_pk30-Apr-10 0:51
arun_pk30-Apr-10 0:51 
JokeRe: Sub menu Item Check and uncheck in Win 32 Pin
Code-o-mat30-Apr-10 1:08
Code-o-mat30-Apr-10 1:08 
GeneralRe: Sub menu Item Check and uncheck in Win 32 Pin
enhzflep30-Apr-10 1:14
enhzflep30-Apr-10 1:14 
Questionfstream read and write [modified] Pin
varsha_vm29-Apr-10 18:45
varsha_vm29-Apr-10 18:45 
I am having following code sample which uses fstream object to Read some buffered value and write the buffer at certain location in the another .cpp file. The code works perfectly i.e. It inserts the desired buffer at desired location. But if I try to open the output file to verify the logic, it opens like binary file(like dll) and not like normal CPP file in MSDEV. However it opens normaly in notepad. I am expecting it to open like normal CPP file in MSDEV.

fstream objFileStream(strFileName,(ios::out|ios::in|ios::nocreate),filebuf::sh_read);

while(objFileStream.getline(szBuffer,iCount,'\n')&&(bMoveToNextID==false))
{
	strBuffer=szBuffer;
	if((strBuffer.Find(strID))!=-1)
	{	
		_tcscpy(szBuffer,strInsertText);
		objFileStream.write(szBuffer,strInsertText.GetLength());
		objFileStream.write("\n",3);
		bMoveToNextID=true;
		
	}
}
objFileStream.close();


modified on Friday, April 30, 2010 2:17 AM

AnswerRe: fstream read and write Pin
Saurabh.Garg29-Apr-10 19:00
Saurabh.Garg29-Apr-10 19:00 
GeneralRe: fstream read and write Pin
varsha_vm29-Apr-10 20:17
varsha_vm29-Apr-10 20:17 
QuestionRe: fstream read and write Pin
David Crow30-Apr-10 3:25
David Crow30-Apr-10 3:25 
AnswerRe: fstream read and write Pin
varsha_vm2-May-10 18:54
varsha_vm2-May-10 18:54 
Question'Generating code' and stop in building release mode (Visual Studio 2005 ) Pin
cchcc29-Apr-10 16:32
cchcc29-Apr-10 16:32 
AnswerRe: 'Generating code' and stop in building release mode (Visual Studio 2005 ) Pin
Sarath C29-Apr-10 17:51
Sarath C29-Apr-10 17:51 
GeneralRe: 'Generating code' and stop in building release mode (Visual Studio 2005 ) Pin
cchcc29-Apr-10 18:12
cchcc29-Apr-10 18:12 
QuestionwaveOutWrite - sound duration Pin
Crazy Joe Devola29-Apr-10 16:23
Crazy Joe Devola29-Apr-10 16:23 
AnswerRe: waveOutWrite - sound duration Pin
enhzflep29-Apr-10 17:07
enhzflep29-Apr-10 17:07 
AnswerRe: waveOutWrite - sound duration Pin
Crazy Joe Devola29-Apr-10 18:22
Crazy Joe Devola29-Apr-10 18:22 
GeneralRe: waveOutWrite - sound duration Pin
enhzflep29-Apr-10 21:01
enhzflep29-Apr-10 21:01 
GeneralRe: waveOutWrite - sound duration Pin
Crazy Joe Devola29-Apr-10 21:10
Crazy Joe Devola29-Apr-10 21:10 
Questionnew mfc controls (vs 2010) loose their visual style at ruining time for dialog based applications Pin
m_code29-Apr-10 9:30
m_code29-Apr-10 9:30 
AnswerRe: new mfc controls (vs 2010) loose their visual style at ruining time for dialog based applications Pin
Sarath C29-Apr-10 18:07
Sarath C29-Apr-10 18:07 
QuestionRe: new mfc controls (vs 2010) loose their visual style at ruining time for dialog based applications Pin
m_code29-Apr-10 18:54
m_code29-Apr-10 18:54 
AnswerRe: new mfc controls (vs 2010) loose their visual style at ruining time for dialog based applications Pin
asight19-Aug-11 4:02
asight19-Aug-11 4:02 
QuestionBest way to send mail through MFC Pin
mesajflaviu29-Apr-10 6:34
mesajflaviu29-Apr-10 6:34 

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.