__declspec(delphirecord)
Go Up to Keywords, Alphabetical Listing Index
Category
Modifiers (C++), Keyword Extensions, Storage Class Specifiers (C++)
Syntax
__declspec( delphirecord ) declarator
The delphirecord storage class attribute is used when converting Delphi records into C++ classes/structs in .hpp headers (using dcc32 -JPHNE <filename.pas>). In Delphi there is a convention regarding records being returned from functions, which states that a function returning a record will return a hidden parameter pointing to the record to be returned. Delphi returns a pointer to a location that is zero initialized, whereas C++ does not offer such a guarantee. For compliance, when C++ finds a struct that is being returned from a function and is flagged as __declspec(delphirecord), it will zero out the memory location.
Note: There is one particular case when a user may want to declare a struct __declspec(delphirecord) explicitly: for a record originally declared in Delphi that has either the {$EXTERNALSYM} or the {$NODEFINE} directive.