Click here to Skip to main content
16,006,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: copying file to another file.. Pin
ThatsAlok6-Jun-05 1:05
ThatsAlok6-Jun-05 1:05 
GeneralRe: copying file to another file.. Pin
mpallavi6-Jun-05 1:34
mpallavi6-Jun-05 1:34 
GeneralRe: copying file to another file.. Pin
Cedric Moonen6-Jun-05 0:01
Cedric Moonen6-Jun-05 0:01 
GeneralRe: copying file to another file.. Pin
ThatsAlok6-Jun-05 0:08
ThatsAlok6-Jun-05 0:08 
GeneralRe: copying file to another file.. Pin
mpallavi5-Jun-05 21:43
mpallavi5-Jun-05 21:43 
GeneralRe: copying file to another file.. Pin
Nilesh K.5-Jun-05 22:02
Nilesh K.5-Jun-05 22:02 
GeneralRe: copying file to another file.. Pin
mpallavi5-Jun-05 22:13
mpallavi5-Jun-05 22:13 
GeneralRe: copying file to another file.. Pin
Nilesh K.5-Jun-05 22:31
Nilesh K.5-Jun-05 22:31 
I've corrected the code, try this out..
<br />
CFile source;<br />
CFile dest;<br />
char strFilter[] = { "Log Files (*.log)|*.log|" };<br />
CFileDialog FileDlg(FALSE, ".log", NULL, 0, strFilter);<br />
<br />
if( source.Open("LogFile.log", CFile::modeRead | CFile::shareDenyWrite ) == FALSE )<br />
return false;<br />
<br />
if( FileDlg.DoModal() == IDOK )<br />
{<br />
if( dest.Open(FileDlg.GetPathName(),CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate)==FALSE)<br />
return false;<br />
CString fl;<br />
fl=FileDlg.GetPathName();<br />
<br />
char c[1000];<br />
int ncount = 0;<br />
do<br />
{<br />
	memset(c,0,1000);<br />
	 ncount = source.Read(c,1000);<br />
	if(ncount > 0)<br />
		dest.Write(c,ncount);<br />
}<br />
while(ncount>0);<br />
<br />
source.Close();<br />
dest.Close();<br />
}<br />





<bold>- Nilesh
<italics>
"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw

GeneralRe: copying file to another file.. Pin
mpallavi5-Jun-05 22:41
mpallavi5-Jun-05 22:41 
GeneralA question about SendMessage in MFC Pin
inew5-Jun-05 17:28
inew5-Jun-05 17:28 
GeneralRe: A question about SendMessage in MFC Pin
ThatsAlok5-Jun-05 18:09
ThatsAlok5-Jun-05 18:09 
GeneralRe: A question about SendMessage in MFC Pin
inew5-Jun-05 18:27
inew5-Jun-05 18:27 
GeneralRe: A question about SendMessage in MFC Pin
ThatsAlok5-Jun-05 19:29
ThatsAlok5-Jun-05 19:29 
GeneralRe: A question about SendMessage in MFC Pin
Nilesh K.5-Jun-05 22:08
Nilesh K.5-Jun-05 22:08 
GeneralRe: A question about SendMessage in MFC Pin
MailtoGops6-Jun-05 5:03
MailtoGops6-Jun-05 5:03 
GeneralA question about CRichEditCtrl Pin
fanlovefan5-Jun-05 15:31
fanlovefan5-Jun-05 15:31 
GeneralRe: A question about CRichEditCtrl Pin
Christian Graus5-Jun-05 15:42
protectorChristian Graus5-Jun-05 15:42 
GeneralRe: A question about CRichEditCtrl Pin
fanlovefan5-Jun-05 17:12
fanlovefan5-Jun-05 17:12 
GeneralTCP service Pin
prof.hell5-Jun-05 15:11
prof.hell5-Jun-05 15:11 
GeneralRe: TCP service Pin
ThatsAlok5-Jun-05 17:56
ThatsAlok5-Jun-05 17:56 
Questionhelp with toolbar with 256 color icons? Pin
nm_1145-Jun-05 13:55
nm_1145-Jun-05 13:55 
GeneralADO error 340 Pin
no_oop_please5-Jun-05 13:18
no_oop_please5-Jun-05 13:18 
GeneralRe: ADO error 340 Pin
no_oop_please5-Jun-05 13:31
no_oop_please5-Jun-05 13:31 
GeneralRe: ADO error 340 Pin
no_oop_please6-Jun-05 5:49
no_oop_please6-Jun-05 5:49 
QuestionJavaScript Suggestions? Pin
bitpusher5-Jun-05 11:14
bitpusher5-Jun-05 11:14 

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.