Click here to Skip to main content
15,898,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: two windows, I want to know which one is on the another one! Pin
eat_union8-Feb-07 20:33
eat_union8-Feb-07 20:33 
Questiondefeat image processing Pin
hoa_nguyen8-Feb-07 15:59
hoa_nguyen8-Feb-07 15:59 
AnswerRe: defeat image processing Pin
Christian Graus8-Feb-07 16:40
protectorChristian Graus8-Feb-07 16:40 
QuestionFileOpen Problem Pin
Aint8-Feb-07 14:27
Aint8-Feb-07 14:27 
AnswerRe: FileOpen Problem Pin
Ravi Bhavnani8-Feb-07 14:53
professionalRavi Bhavnani8-Feb-07 14:53 
AnswerRe: FileOpen Problem Pin
Sumesh V.V8-Feb-07 18:00
Sumesh V.V8-Feb-07 18:00 
AnswerRe: FileOpen Problem Pin
Sameer_Thakur8-Feb-07 18:42
Sameer_Thakur8-Feb-07 18:42 
QuestionBest way to duplicate a file? Pin
Sousch8-Feb-07 14:19
Sousch8-Feb-07 14:19 
Hello,

I'm having a problem when I try to save a file in a different directory (let's say that I simply want to duplicate the file). I have a "default.wav" in my directory and I use a dialog to save it (duplicate it) in another directory with a different name. This is my code:

============
CString strFile;
(...)

strFile = dlg.GetPathName();
(...)

CFile file_orig,file_dest;
char *pBuffer;
(...) <- part that creates "default.wav" in the same directory

file_orig.Open("default.wav", CFile::modeRead);

int length = file_orig.GetLength(); // <<<<< here is the problem !!
pBuffer = (char*)malloc(length);

file_orig.Read(pBuffer, length);
file_orig.Close();

file_dest.Open( strFile, CFile::modeCreate|CFile:: modeReadWrite);
file_dest.Write(pBuffer, file_orig.GetLength());
file_dest.Close();

free(pBuffer);
==============

Any solution that works can be valid (without including aditional libraries if possible). I just want to keep it as simple as possible.

Thanks in advance!
Smile | :)
AnswerRe: Best way to duplicate a file? Pin
Ravi Bhavnani8-Feb-07 14:26
professionalRavi Bhavnani8-Feb-07 14:26 
AnswerRe: Best way to duplicate a file? Pin
Mark Salsbery8-Feb-07 14:32
Mark Salsbery8-Feb-07 14:32 
GeneralRe: Best way to duplicate a file? Pin
Sousch8-Feb-07 15:15
Sousch8-Feb-07 15:15 
GeneralRe: Best way to duplicate a file? Pin
Mark Salsbery8-Feb-07 15:24
Mark Salsbery8-Feb-07 15:24 
AnswerRe: Best way to duplicate a file? Pin
cp98768-Feb-07 15:35
cp98768-Feb-07 15:35 
AnswerRe: Best way to duplicate a file? Pin
Sumesh V.V8-Feb-07 18:03
Sumesh V.V8-Feb-07 18:03 
GeneralRe: Best way to duplicate a file? Pin
Hamid_RT8-Feb-07 18:25
Hamid_RT8-Feb-07 18:25 
QuestionFinding the renderer filter in the directshow's filtergraph Pin
emrah.a8-Feb-07 11:37
emrah.a8-Feb-07 11:37 
AnswerRe: Finding the renderer filter in the directshow's filtergraph Pin
Mark Salsbery8-Feb-07 12:35
Mark Salsbery8-Feb-07 12:35 
QuestionOh No. What Have I done. Pin
Chris Meech8-Feb-07 11:03
Chris Meech8-Feb-07 11:03 
AnswerRe: Oh No. What Have I done. Pin
Mark Salsbery8-Feb-07 11:24
Mark Salsbery8-Feb-07 11:24 
GeneralRe: Oh No. What Have I done. Pin
Chris Meech8-Feb-07 11:35
Chris Meech8-Feb-07 11:35 
GeneralRe: Oh No. What Have I done. Pin
Mark Salsbery8-Feb-07 12:26
Mark Salsbery8-Feb-07 12:26 
AnswerRe: Oh No. What Have I done. Pin
Stephen Hewitt8-Feb-07 11:46
Stephen Hewitt8-Feb-07 11:46 
GeneralRe: Oh No. What Have I done. Pin
Chris Meech8-Feb-07 12:07
Chris Meech8-Feb-07 12:07 
AnswerRe: Oh No. What Have I done. Pin
Michael Dunn8-Feb-07 16:34
sitebuilderMichael Dunn8-Feb-07 16:34 
QuestionShould I migrate from Visual C++ 6 to Visual C++ 2005 Pin
Wei Cheng8-Feb-07 10:45
Wei Cheng8-Feb-07 10:45 

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.