home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!hp-cv!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!eagle!rogers
- From: rogers@eagle (Bill Rogers)
- Newsgroups: comp.lang.c++
- Subject: RE:Help? TV stream...DAMN!
- Message-ID: <Bt8yuw.E40@news.cso.uiuc.edu>
- Date: 19 Aug 92 20:13:43 GMT
- Article-I.D.: news.Bt8yuw.E40
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: Sangamon State University
- Lines: 37
- X-Newsreader: Tin 1.1 PL4
-
- My newreader and emacs are fighting each other. Sorry bout that above.
-
- Let's start again.
-
- How do I check to see if a stream created object was actually creted without
- error? Here is the constructor that seems to work just fine, I can't
- tell the caller what happen without using a global, something I'd rather not.
-
-
- TFieldCollection::TFieldCollection( char *filename ):
- TCollection (streamableInit ) {
- if(filename == NULL) return;
- ifpstream in( filename );
- if (in) {
- // This is cool, but I could use some error checking here also.
- in >> *this;
- in.close();
- } else { // Damn no file found!
- messageBoxRect (TRect(10,10,50,19),mfOKButton,
- "Damn! file: %s not opened.",filename );
- } /* if (in) */
- }
-
- I call this like:
- TFieldCollection *fc = new TFieldCollection("somefile.ext");
- but:
- if(fc) //doesn't seem to work
-
- TIA,
- Bill
- --
- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
- <> Bill Rogers, Assistant Director for Academic Computing Services <>
- <> Sangamon State University, HSB-115 <>
- <> Springfield, Il 62794-9243 fax:217-786-7188 <>
- <> Internet:rogers@eagle.sangamon.edu voice:217-786-7352(Mon.->Thur.)<>
- <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-