NullableDateTime in C++Builder... does not compile, at least with classic compiler

Hello,

I have never used (or tried to use) Nullable datatypes before. Today I changed one field, a DateTime, for a NullableDateTime, in one of my RODL and regenerated the _Intf files.

When trying to compile it, the following error is produced:

[C++ Error] Ts4_types_intf.h(5263, 46): E2109 Not an allowed type

The line in question is:

		__property NullableDateTime ProximoIntento = {read=fProximoIntento, write=fProximoIntento};

Any idea of how to workaround this?

I am on version .1623, and using RAD Studio 12.3, classic C++Builder compiler.

Thanks!

Hi,

looks like classic compiler disallows to use delphi records as published properties.

you can try this workaround:

  • update project file //#ROGEN:Ts4_types.rodl to //#RO GEN:Ts4_types.rodl so your Ts4_types_intf.h won’t be regenerated automatically
  • update Ts4_types_intf.h and declare ProximoIntento property as public like
public:
  __property NullableDateTime ProximoIntento = {read=fProximoIntento, write=fProximoIntento};

after this, your project should be compiled.


btw, you can use usual Variant instead of NullableDateTime for passing null and usual values.