thub.users.profile.tabs.comments.personalized


Sorry, that i try to anwser this shortly (know it's offtopic). Serialization does only work with objects derived from "CObject" that have their own classinfo. It does not work with "CObject" itself. Deserialisation does always at first have to read the classinfo to know what objecttype was serialized. This a bit tricky with template classes like "CTypedPtrArray".

Short example: If you have a Type defined like "CTypedPtrArray<CPtrArray, MyClass*>" it will be derived from "CPtrArray" wich is derived from "CObject". But "CPtrArray" is "DECLARE_DYNAMIC" defined an not "DECLARE_SERIAL" (so it has no own serialization methods). This cause the "<<" and ">>" operator to fallback to "CObject"'s serialisation methods.

So you should not use the serialisation operator "<<" and you can't use the deserialisation operator ">>" on such types.

You have to iter over the elements and serialize them manual and don't forget to serialize the array size (in my example)

Hope it helps .



Well I do know why I got the 0xC0000005, because after the deserialization of a "COleVariant" (wich was a "VT_BSTR" type with a Null length string on serialization) you get back a VARIANT of type "VT_BSTR" with an invalid "bstrVal" Pointer (it's NULL !!).

So you can't use "bstrVal" without checking it for "NULL" value.

What I think is, that a VARIANT of "VT_BSTR" type should always have a valid "bstrVal" pointer, or not?

Ok one last comment on this (sorry;). I took a short look at the "LPCTSTR" constructor and the "LPCTSTR" equal operator. Both implementations do set "bstrVal" to a valid pointer to an empty string, so only the deserialization operator does not.