[ROOT] Inspect() method fails

From: Ed Oltman (eoltman@imago.com)
Date: Fri Jan 17 2003 - 20:59:23 MET


I am using root 3.03/9a (and have tried root 3.04/2 for this purpose - same
problem)
on Win2k. I have an object that derives from TObject that I write to a root
file
using a stand-alone application build with VC++ 6.0.  When I open and read
the root
file from the root program itself and try

	root [] .L mystuff.dll
	root [] obj->Inspect()

where mystuff.dll is the same dll I used to generate the object - built
using
rootcint+linkdef file. A window breifly appears, than disappears and I get
an error:

Error: C++ exception caught FILE:C:\DOCUME~1\eoltman\LOCALS~1\Temp\67 LINE:1
*** Interpreter error recovered ***

However, if I perform

	root [] obj->Dump()

the object data displays properly.  Any ideas what might be going on would
be
be greatly appreciated.  Thanks

Ed Oltman


Some details:
mystuff.dll was made as a Win32 DLL: it consists of 2 classes: A and B.  B
derive
from TObject and the "obj" that appears above is an instance of B.  Class A
has
a member variable of type  B*. A is exported/imported using the normal
windows scheme:


class __declspec(dllexport) A
{
  .
  .  B *fObj
  .
};


When I build the Win32 DLL project, I include dict.cpp, dict.h that are made
with

	rootcint -f dict.cpp -c B.h linkdef.h

where linkdef.h looks like:

	#ifdef __CINT__

	#pragma link off all globals;
	#pragma link off all classes;
	#pragma link off all functions;

	#pragma link C++ class B-;

	#endif

and I supplied my own streamer:

void B::Streamer(TBuffer &R__b)
{
   // Stream an object of class B.
   UInt_t R__s, R__c;
   if (R__b.IsReading()) {
      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
      TObject::Streamer(R__b);
		.
		.
      R__b.CheckByteCount(R__s, R__c, B::IsA());
   } else {
      R__c = R__b.WriteVersion(CRunHeader::IsA(), kTRUE);
      TObject::Streamer(R__b);
		.
		.
      R__b.SetByteCount(R__c, kTRUE);
   }
}



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET