> In detachFromCollection(), you declare a local TreeId. A TreeId is currently
> defined as a typedef for a ulong. Defining a local variable of a C++ built-in
> type does no initialization, so the value of lTreeId is garbage.
This is now fixed. Actually, the variable would not have been used, but I agree it's cleaner that way. Thanks for noticing.
> In detachFromColle ction() , you declare a local TreeId. A TreeId is currently
> defined as a typedef for a ulong. Defining a local variable of a C++ built-in
> type does no initialization, so the value of lTreeId is garbage.
This is now fixed. Actually, the variable would not have been used, but I agree it's cleaner that way. Thanks for noticing.