Hi Volker, Following a mail from Axel, I just realize that I misunderstood your question. Why do you want to call TClass::New to create a new object ? Why don't you call directly the class constructor? In case, you want to create an object when you know only the name ot its class (could be what you try to do?), you can use the interpreter ProcessLine, Example: gInterpreter.ProcessLine("new TH1F(\"h\",\"h\",100,-3,3)") will create a new TH1F object. In this particular case, you can retrieve a pointer to the created object via gDirectory->Get("h"): the TH1F constructor adding automatically a reference to the object in the list of objects of the current directory. You can modify your constructor to automatically register itself to some collection. Rene Brun Volker Hejny wrote: > > Hallo, > > if I have a class name as a string value at run time, it is possible > to construct a new object of this class using TClass::New(). That > way the standard constructor is called. Is there any way to call > a different constructor with a given argument? > > Best regards, > Volker > > -- > Dr. Volker Hejny Tel: 02461/616853 ** > Institut f. Kernphysik Fax: 02461/613930 ** > ---------------------------------------------------------------- ** ** --- > Forschungszentrum Juelich GmbH, D-52425 Juelich **
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:09 MET