> Hi,
>
[quoted text clipped - 14 lines]
> I tried Class::GetType() but that generates a compile error C2352 (illegal
> call of non-static member function) and it doesn't look like 'typeof' exists.
1)
well if the question is how to write the "typeof(...)" statement of
above have a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemxmlserializationxmlserializerclassctortopic2.asp
important line is
XmlSerializer* serializer =
new XmlSerializer(__typeof(OrderedItem));
2)
if you mean that you dont know the type of class you are deserializing
at all, there is a problem: you have to.
anyway if you dont know what it is what you are dealing with, what would
you do with it?
if it was the second, be more explicit about what you want to do
cheers,
paul
Meta-Meta - 30 Apr 2005 00:06 GMT
Paul,
My problem is not with Serializing but deserializing, and not in C# but in
VC++ .NET.
When deserializing, the object does not exist yet, as it will be created as
a result of the deserialization therefore I cannot get the type from the
object (or so argues the compiler ;-) ).
The example supplied in MSDN is in C# and shows the serializer getting the
type from the Class (not object) for deserialization (see C# code snippet in
my first post).
What I do not know how to do in VC++ is to get the type of the Class as
'typeof' does not exist and as I was unable to find an equivalent
method/function for a custon class.
Many thanks,
~Meta-Meta.
> > Hi,
> >
[quoted text clipped - 36 lines]
> cheers,
> paul