Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Base Class Properties are not ignored during application initialization

Hello,

NGSerializer fails with an error during startup when I try and serialize an Exception sub class even though I have [NoInherited] Attribute to the sub class. So I have the following class defined that I want to serialize:

[NoInherited]
MyException = Class(Exception)
private
. . . .
public
 Property ErrorMsg : String . . . 
 Property ErrorCode : Integer . . .,
 Property ExtendedErrorMessage : String . . .
end;

Then in my return code I create a serializer like this:

Serializer := TNativeXMLSerializer<MyException>.Create;

When I attempt to start my application I get the following error. <MyApp.exe> raised exception class ESerialize with message 'Cannot serialize values of type Pointer' When looking at the base Exception class there is a public property that is a pointer, but since I have specified NoInherited attribute these should be ignored. Is this a Bug?. 

I have also noticed this same error with a property in the serializable class marked with the Transient attribute. 

Why doesn't the serializer actually ignore Transient and inherited properties during startup when these attributes are used?

Thanks,

Todd Flora.

Comments

Sign In or Register to comment.