Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog and multiple inheritance Pin
Rage26-Jan-03 23:50
professionalRage26-Jan-03 23:50 
Generaltoolbar programming question Pin
trustno126-Jan-03 23:29
trustno126-Jan-03 23:29 
GeneralRe: toolbar programming question Pin
Rage27-Jan-03 0:37
professionalRage27-Jan-03 0:37 
QuestionInstallation wizard? Pin
*Tom*26-Jan-03 23:23
*Tom*26-Jan-03 23:23 
AnswerRe: Installation wizard? Pin
Rage26-Jan-03 23:51
professionalRage26-Jan-03 23:51 
GeneralRe: Installation wizard? Pin
*Tom*27-Jan-03 0:01
*Tom*27-Jan-03 0:01 
AnswerRe: Installation wizard? Pin
Renjith Ramachandran27-Jan-03 2:42
Renjith Ramachandran27-Jan-03 2:42 
GeneralHandling the user (when takes out a floppy disk while it is working) Pin
Joan M26-Jan-03 22:22
professionalJoan M26-Jan-03 22:22 
This is the code that I use in order to backup the little documents used by my programs into a 3 1/2 floppy.

It's placed in a separate thread in order to avoid the hanging effect that produces a long operation and it works perfect while the floppy disk is in the drive.

The problems appear when somebody takes out the floppy disk while the copy operation is taking place.

Here's the code that I use (if you want you can take a look at it in order to see what I can have missed)

//----------------------------------------------------
// Simple way in order to backup a file from the HDD 
// to a 3 1/2 floppy.
//----------------------------------------------------
ireturn = CopyFile(csFullPathSource, csFullPathDestination, FALSE);

if (ireturn == 0)
{
	iErrors++;
	csAuxiliar += " : registrado error en éste proceso";

	bTrobatError = true;
}

//----------------------------------------------------
// In order to maintain a control of what is happening...
// The log is written to the same disk...
// This allows the user to know what that disk contents, 
// backup sessions active...
//----------------------------------------------------
dwFileSize = GetFileSize(hLog,NULL);
SetFilePointer (hLog, dwFileSize, NULL, FILE_BEGIN);

WriteFile(hLog,
	  csLog,
  	  strlen(csLog),
	  &dwNBWritten,
	  NULL);

CloseHandle(hLog);
csLog.ReleaseBuffer(0);


Thank you in advance.
GeneralRe: Handling the user (when takes out a floppy disk while it is working) Pin
Rage26-Jan-03 23:54
professionalRage26-Jan-03 23:54 
GeneralRe: Handling the user (when takes out a floppy disk while it is working) Pin
benjymous26-Jan-03 23:57
benjymous26-Jan-03 23:57 
GeneralRe: Handling the user (when takes out a floppy disk while it is working) Pin
*Tom*27-Jan-03 11:26
*Tom*27-Jan-03 11:26 
GeneralRe: Handling the user (when takes out a floppy disk while it is working) Pin
Joan M27-Jan-03 21:22
professionalJoan M27-Jan-03 21:22 
GeneralRe: Handling the user (when takes out a floppy disk while it is working) Pin
*Tom*28-Jan-03 0:12
*Tom*28-Jan-03 0:12 
GeneralInvalid memory access while accessing a dll exported variable Pin
shaunakshaunak26-Jan-03 22:17
shaunakshaunak26-Jan-03 22:17 
GeneralLinker Error Pin
suresh_sathya26-Jan-03 21:53
suresh_sathya26-Jan-03 21:53 
GeneralRe: Linker Error Pin
Daniel Strigl26-Jan-03 22:32
Daniel Strigl26-Jan-03 22:32 
GeneralRe: Linker Error Pin
Mike Nordell27-Jan-03 9:44
Mike Nordell27-Jan-03 9:44 
GeneralMetafile playing(URGENT) Pin
satyavasu26-Jan-03 21:50
satyavasu26-Jan-03 21:50 
GeneralQuestion about thread and TLS Pin
George226-Jan-03 21:40
George226-Jan-03 21:40 
GeneralRe: Question about thread and TLS Pin
George226-Jan-03 21:41
George226-Jan-03 21:41 
GeneralContext menu and Dialog names Pin
Rage26-Jan-03 21:21
professionalRage26-Jan-03 21:21 
GeneralRe: Context menu and Dialog names Pin
KaЯl27-Jan-03 0:23
KaЯl27-Jan-03 0:23 
GeneralRe: Context menu and Dialog names Pin
Rage27-Jan-03 0:45
professionalRage27-Jan-03 0:45 
Generale-mail client Pin
Anonymous26-Jan-03 21:02
Anonymous26-Jan-03 21:02 
GeneralRe: e-mail client Pin
benjymous27-Jan-03 0:00
benjymous27-Jan-03 0:00 

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.