Question

I just downloaded the ADSI and it seems to be that it is not compatible with Delphi Embarcadero XE4.

When I try to compile one of the examples, I get this error:

[dcc32 Error] adshlp.pas(128): E2003 Undeclared identifier: 'NULL'

And this is the line:

varArr := NULL;

What's wrong?

Was it helpful?

Solution

Null used to be declared in the System unit, so it was available globally. In Delphi 6, all Variant-related code moved out of that unit and into the new Variants unit. Since Null is a function that returns a Variant, Null was included in the move, so it is no longer available implicitly.

To fix the old code, simply add Variants to your uses clause in any unit that needs it:

uses ..., Variants;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top