Click here to Skip to main content
15,894,825 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Can I use std::tr1::share_ptr in VS2008 SP1 to replace auto_ptr in my project? Pin
hawkgao012922-Jul-09 20:21
hawkgao012922-Jul-09 20:21 
GeneralRe: Can I use std::tr1::share_ptr in VS2008 SP1 to replace auto_ptr in my project? Pin
Stuart Dootson22-Jul-09 21:34
professionalStuart Dootson22-Jul-09 21:34 
GeneralRe: Can I use std::tr1::share_ptr in VS2008 SP1 to replace auto_ptr in my project? Pin
hawkgao012922-Jul-09 22:03
hawkgao012922-Jul-09 22:03 
GeneralRe: Can I use std::tr1::share_ptr in VS2008 SP1 to replace auto_ptr in my project? Pin
hawkgao012922-Jul-09 22:13
hawkgao012922-Jul-09 22:13 
GeneralRe: Can I use std::tr1::share_ptr in VS2008 SP1 to replace auto_ptr in my project? Pin
Stuart Dootson22-Jul-09 22:18
professionalStuart Dootson22-Jul-09 22:18 
Questionifstream read() logic? Pin
John R. Shaw13-Jul-09 9:32
John R. Shaw13-Jul-09 9:32 
AnswerRe: ifstream read() logic? Pin
Stuart Dootson13-Jul-09 13:10
professionalStuart Dootson13-Jul-09 13:10 
GeneralRe: ifstream read() logic? Pin
John R. Shaw13-Jul-09 19:38
John R. Shaw13-Jul-09 19:38 
Here is that basic problem, the while loop works great but the test calls an over-ride that is just checking if the EOF has been reached (overloaded … etc.). Which makes since accept when that is not true? If an error occurs while reading, you need to know that is what happened; just saying that you have reached the EOF, when untrue, gives the wrong information. An error has occurred, true, but it is not because you reached the end of the file (EOF). This little piece of information is very important. One work around, which applies to C as well, is to get the size of the file before reading it; is to compare the number of bytes read as opposed to the size of the file. The main difference between C and C++ (I may be wrong) is that a read error can occur without reaching the EOF, so you need to check for both while reading a file. I will grant that if you try to read past the EOF that it is an error and you have reached the EOF. But before reaching the EOF, only an error flag should be set; indicating that a read occurred. If it sets the failbit and the eofbit every time an error occurs, it is self defeating and is lying to the developer

INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

GeneralRe: ifstream read() logic? Pin
Stuart Dootson13-Jul-09 21:19
professionalStuart Dootson13-Jul-09 21:19 
GeneralRe: ifstream read() logic? [modified] Pin
John R. Shaw14-Jul-09 7:11
John R. Shaw14-Jul-09 7:11 
QuestionChevron effect not showing Icon in IE6 (Windows XP) Pin
am 200913-Jul-09 5:24
am 200913-Jul-09 5:24 
AnswerRe: Chevron effect not showing Icon in IE6 (Windows XP) Pin
Gerald Schwab10-Aug-09 18:29
Gerald Schwab10-Aug-09 18:29 
GeneralRe: Chevron effect not showing Icon in IE6 (Windows XP) Pin
am 20094-Nov-09 22:25
am 20094-Nov-09 22:25 
QuestionSingle instance setting for out-of-proc COM server? Pin
WayneS13-Jul-09 3:25
WayneS13-Jul-09 3:25 
QuestionHelp,About Picture Stock Property in ATL Pin
Pearson_Bee12-Jul-09 21:01
Pearson_Bee12-Jul-09 21:01 
QuestionAnother 8001010e question! Pin
Kannan Ramanathan11-Jul-09 7:13
Kannan Ramanathan11-Jul-09 7:13 
AnswerRe: Another 8001010e question! Pin
Stuart Dootson11-Jul-09 7:30
professionalStuart Dootson11-Jul-09 7:30 
GeneralRe: Another 8001010e question! Pin
Kannan Ramanathan11-Jul-09 7:41
Kannan Ramanathan11-Jul-09 7:41 
GeneralRe: Another 8001010e question! Pin
Stuart Dootson11-Jul-09 7:52
professionalStuart Dootson11-Jul-09 7:52 
GeneralRe: Another 8001010e question! Pin
Kannan Ramanathan11-Jul-09 18:23
Kannan Ramanathan11-Jul-09 18:23 
GeneralRe: Another 8001010e question! Pin
Stuart Dootson11-Jul-09 23:37
professionalStuart Dootson11-Jul-09 23:37 
GeneralRe: Another 8001010e question! Pin
Kannan Ramanathan11-Jul-09 23:43
Kannan Ramanathan11-Jul-09 23:43 
GeneralRe: Another 8001010e question! Pin
Stuart Dootson11-Jul-09 23:47
professionalStuart Dootson11-Jul-09 23:47 
GeneralRe: Another 8001010e question! Pin
Kannan Ramanathan12-Jul-09 1:57
Kannan Ramanathan12-Jul-09 1:57 
GeneralRe: Another 8001010e question! Pin
Stuart Dootson12-Jul-09 5:48
professionalStuart Dootson12-Jul-09 5:48 

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.