[edit2: RESOLVED, please disregard.]
[edit: (1) I forgot to include the LinkDef.h, but I did also use rootcint to generate the dictionaries.]
Could anyone point me in the right direction on this… I’m having a problem retrieving objects (base class TObject) from a TCollection, and I’ve tried to isolate and extract the relevant idea in test.cpp (attached). Everything works fine when I retrieve objects from the collection by using the key, but it does not work when I use the iterator. The attached test program is set up as the following pseudo-code indicates:
class Histo : public TObject
class HistoPid : public Histo
main:
Histo* h = new HistoPid
check property of h (good, as in 1 in output below)
TMap* m
m->Add(key,h)
retrieve h by key (good, as in 2 in output below)
retrieve h via TIter (bad as in 3 in output below)
Output:
$ testme
1. h_test
2. h_test
3. UH��SH��H��H��P�H�x��J��҉H�u��A��H��8H�PH�@���tW@���|$
���(`���t$
H��H���~*H�
H���H��:H��H��H)�@�<0��H�)�9D$
�H��[]�
Regards,
Evan
test.cpp (1.07 KB)