Click here to Skip to main content
15,920,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetTimer Pin
Ravi Bhavnani17-Apr-03 19:28
professionalRavi Bhavnani17-Apr-03 19:28 
GeneralRe: SetTimer Pin
Toni7817-Apr-03 19:34
Toni7817-Apr-03 19:34 
GeneralRe: SetTimer Pin
Michael Dunn17-Apr-03 19:36
sitebuilderMichael Dunn17-Apr-03 19:36 
GeneralRe: SetTimer Pin
Ravi Bhavnani17-Apr-03 20:44
professionalRavi Bhavnani17-Apr-03 20:44 
GeneralRe: SetTimer Pin
David Crow18-Apr-03 4:26
David Crow18-Apr-03 4:26 
GeneralRestrict user from accessing drives Pin
svsrikanth17-Apr-03 18:07
svsrikanth17-Apr-03 18:07 
GeneralRe: Restrict user from accessing drives Pin
David Crow18-Apr-03 5:01
David Crow18-Apr-03 5:01 
GeneralQuestion about the state of a stream. Pin
George217-Apr-03 17:18
George217-Apr-03 17:18 
Hi, everyone!

Suppose I have a istream and I want to read an
integer from a istream. If the length is 0 and
I think the stream is correpted and I won't like
any other operations on the stream later. So I
think I can set the state of the stream. The following
is my sample code. I want to know whether my solution
is correct? Are there some other things to consider?



Source codes:
--------

int data;

/** return value is used to indicate whether the return
value is correct.
*/
bool A::Read (std::istream& is)
{
is.exceptions(ios::failbit|ios::eofbit);
try {
is.read ((char*)&data, sizeof (data));

if (!data) {
is.setstate (ios::failbit);
return false;
}
} catch (ios::failure e)
{
return false;
}

return true;
}
--------


Thanks in advance,
George
GeneralTwo programs - Same file Instantaneous write and read. Pin
Pecan20417-Apr-03 16:52
Pecan20417-Apr-03 16:52 
GeneralRe: Two programs - Same file Instantaneous write and read. Pin
Michael Dunn17-Apr-03 17:01
sitebuilderMichael Dunn17-Apr-03 17:01 
GeneralRe: Two programs - Same file Instantaneous write and read. Pin
John M. Drescher17-Apr-03 18:09
John M. Drescher17-Apr-03 18:09 
GeneralRe: Two programs - Same file Instantaneous write and read. Pin
Pecan20418-Apr-03 1:46
Pecan20418-Apr-03 1:46 
GeneralRe: Two programs - Same file Instantaneous write and read. Pin
David Crow18-Apr-03 5:08
David Crow18-Apr-03 5:08 
GeneralCan't write to registry when I use CRegKey... Pin
IrishSonic17-Apr-03 14:56
IrishSonic17-Apr-03 14:56 
GeneralRe: Can't write to registry when I use CRegKey... Pin
David Crow18-Apr-03 4:35
David Crow18-Apr-03 4:35 
QuestionMFC: How to make CView appear outside CFrame? Pin
vawksel17-Apr-03 14:26
vawksel17-Apr-03 14:26 
AnswerRe: MFC: How to make CView appear outside CFrame? Pin
valikac17-Apr-03 16:19
valikac17-Apr-03 16:19 
GeneralFindFirstChangeNotification advice Pin
Bartosz Bien17-Apr-03 12:17
Bartosz Bien17-Apr-03 12:17 
GeneralRe: FindFirstChangeNotification advice Pin
Anders Molin17-Apr-03 14:06
professionalAnders Molin17-Apr-03 14:06 
GeneralURLDownloadToFile is making me mad Pin
MattyBee17-Apr-03 11:38
MattyBee17-Apr-03 11:38 
GeneralRe: URLDownloadToFile is making me mad Pin
Michael Dunn17-Apr-03 11:48
sitebuilderMichael Dunn17-Apr-03 11:48 
GeneralRe: URLDownloadToFile is making me mad Pin
Big Art17-Apr-03 12:18
Big Art17-Apr-03 12:18 
GeneralRe: URLDownloadToFile is making me mad Pin
MattyBee18-Apr-03 4:00
MattyBee18-Apr-03 4:00 
GeneralRe: URLDownloadToFile is making me mad Pin
Big Art18-Apr-03 5:55
Big Art18-Apr-03 5:55 
General"Run As Other User" (NT) Pin
John R. Shaw17-Apr-03 11:33
John R. Shaw17-Apr-03 11:33 

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.