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

C / C++ / MFC

 
GeneralRe: copying file to another file.. Pin
mpallavi6-Jun-05 0:19
mpallavi6-Jun-05 0:19 
GeneralRe: copying file to another file.. Pin
ThatsAlok6-Jun-05 0:42
ThatsAlok6-Jun-05 0:42 
GeneralRe: copying file to another file.. Pin
mpallavi6-Jun-05 0:51
mpallavi6-Jun-05 0:51 
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 
Hi all
I am using CFile class.. here is my code..
........................
void CCNPhoneDlg::OnSave()
{this->UpdateData();
CFile source;
CFile dest;
char strFilter[] = { "Log Files (*.log)|*.log|" };
CFileDialog FileDlg(FALSE, ".log", NULL, 0, strFilter);

if( source.Open("LogFile.log", CFile::modeRead | CFile::shareDenyWrite ) == FALSE )
return;

if( FileDlg.DoModal() == IDOK )
{
if( dest.Open(FileDlg.GetPathName(),CFile::modeCreate | CFile::modeWrite | CFile::modeNoTruncate)==FALSE)
return;
CString fl;
fl=FileDlg.GetPathName();

char c[1000];
int len;
len=strlen("LogFile.txt");
do
{
source.Read(c,1000);
dest.Write(c,len);
}
while (!EOF);
source.Close();
dest.Close();
}
}
..................
But file is not getting created.. whats wrong with the code..?
pallavi
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 
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 

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.