[ROOT] Fw: Re:

From: Brandon Kohn (blk@maia-institute.org)
Date: Mon Apr 22 2002 - 09:34:34 MEST


Ok, I'll try to give a better explanation (the application is rather large,
so let's try theory before example :)

 I have a library (sim.lib) that has a class with a method which accesses a
stack allocated TFile.  After the constructor call of the TFile, I check
file.IsOpen().

 CSim::LoadFile(const char* filename){

     TFile file(filename,"UPDATE");
     if(!file.IsOpen()){
         return 0;
     }//if

 }

 This method works correctly in my applications where it is linked as a
 static library. (.lib)

 I have another project (SimDLL) which is a dll wrapper for the simulator
 library.  In this version, when I call CSim::LoadFile("yada-yada"), I'm
 getting an access violation in libcore.dll on the file>IsOpen() call. (File
 exists and pathing to it is correct).

 Does this illustrate the problem any better?

 Thanks Rene!
 Brandon
>
> ----- Original Message -----
> From: "Rene Brun" <Rene.Brun@cern.ch>
> To: "Brandon Kohn" <blkohn@hotmail.com>
> Cc: "Roottalk List" <roottalk@pcroot.cern.ch>
> Sent: Monday, April 22, 2002 9:13 AM
> Subject: Re:
>
>
> > Please give more details with an example if possible.
> >
> > Rene Brun
> >
> > Brandon Kohn wrote:
> > >
> > >    Part 1.1       Type: Plain Text (text/plain)
> > >               Encoding: quoted-printable
> > Hello rooters,
> >
> > Got a quick question.  I have a library that makes use of a TFile.  When
I
> use
> > this library as a static link, everything is peachy.  When I try use the
> methods
> > within when linking as a dll, the TFile doesn't open.  I suspect that
> gDirectory
> > is NULL or something of this nature.  Any clues on how I should rectify
> this
> > problem?
> >
> > Thanks as usual
> >
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:50 MET