CodePudding user response:
When writing the return of the interface have a judge? Can be judged in terms of writing data return to the interface, if write how many times failure, return an error,But don't know what you specific use interface, did not dare to assert that
CodePudding user response:
Crash is your exception handling does not reach the designated position,
Considering all kinds of possible exception,
CodePudding user response:
You don't put the process of writing the data in the main thread, and every time check exception to write before writing, writing in the process of doing a timer timeout handlingCodePudding user response:
I was written using MFC CFile category, write data also can judge to success or failure? What happened when the timer timeout handling, can detailed say? pleaseCodePudding user response:
I also useful anomaly judgment kind thing, but the result is the same, don't know what to do now, will judge SD card state is, the file is opened, but writing in the process of SD card are pulled out, the result can't write in it? If this is possible?CodePudding user response:
CFile, speaking, reading and writing using the try catch catch CFileExceptionCodePudding user response:
Open a write threads and abnormal judgmentCodePudding user response:
Don't try to the end of the elegant (because it is impossible)And want to be in bad can't lousy can stall on reforming land!
CodePudding user response:
Use CFile add try catch catch CFileException, tried, won't workCodePudding user response:
Can write elsewhere, the SD card, then finish at a time, do it again copy file, determine the path of the SD card before copy is effective, if invalid, ineffective treatment, effective, direct copy,CodePudding user response:
Do a monitor USB monitor thread when there is testing whether you are using USB disconnect the device and modify logo on a write code that judgment, then suggest exit,CodePudding user response:
Try {}Cache {}
Catches no exception
CodePudding user response:
When the system equipment change, they emit WM_DEVICECHANGE message, if the device is removed, the message parameter as DBT_DEVICEREMOVEPENDING, again the moment, can carry out your "helpless" processingCodePudding user response: