Hi John,
The return flags are OK.
Are you sure that your file testfile.root is not being used by another process?
(Windows problem)
Could you try the same operation with a file in your local directory?
Rene Brun
jcfree@socrates.Berkeley.EDU wrote:
>
> Thanks for your quick response--
>
> As for the ROOT version I'm using, it's 3.02/06. I checked the following
> functions in my code:
> "file->IsOpen" returned 1,
> "file->IsZombie" returned 0,
> and "file->Errno" returned 2.
>
> And still, I get a runtime error when I try to write the histogram.
>
> --John
>
> On Sun, 13 Jan 2002, Rene Brun wrote:
>
> > Hi John,
> >
> > Obviously this trivial test works with the standard ROOT executable.
> > Is the TFile constructor reporting an error message ?
> >
> > Which version of ROOT are you using?
> >
> > Rene Brun
> >
> > On Sat, 12 Jan 2002 jcfree@socrates.Berkeley.EDU wrote:
> >
> > >
> > > I've been having a lot of trouble writing histograms to a file in my
> > > program. I'm using VC++ 6 on Windows 2000, and am using the QT libraries
> > > for my GUI interface. Even the simplest code doesn't seem to work, e.g.,
> > >
> > > TFile* file = new TFile("e:\\rt\\testfile.root","UPDATE");
> > > TH1S* testhisto = new TH1S("histo","histo",100,0,100);
> > > testhisto->Write();
> > > file->Close();
> > >
> > > will cause the program to indicate "Abnormal program termination" when
> > > execution reaches the "testhisto->Write()" line. Can anyone help me out?
> > >
> > > Thanks,
> > >
> > > John
> > >
> >
> >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:38 MET