delphi-rest-client-api icon indicating copy to clipboard operation
delphi-rest-client-api copied to clipboard

Problem with GetAsDataSet function of TResource on DelphiXE2

Open jhonatasobrinho opened this issue 8 years ago • 7 comments

I had a problem trying to use that function on Delphi XE2. I think, someway the compile directive USE_SUPER_OBJECT was defined, but I can't specify where. So, the GetAsDataSet function wasn't avaiable for use.

I solved this problem taking off the {$UNDEF USE_SUPER_OBJECT} directive from {$IFDEF MACOS}, compiling the component again and compiling my project. So it worked. That is a bug or just my fail somewhere?

jhonatasobrinho avatar Mar 05 '16 03:03 jhonatasobrinho

It's not a bug, the GetAsDataset is only available if you are using SuperObject.

Apparently, USE_SUPER_OBECT is defined by default (DelphiRest.inc#L6), but not for MacOS (DelphiRest.inc#L203)

I'm not sure why this is defined like that. My guess is some compatibility issues. Maybe @fabriciocolombo know something.

RobertoSchneiders avatar Mar 07 '16 12:03 RobertoSchneiders

Yes. Apparently it's not a bug, but I couldn't access this function. I had to take off the UNDEF USE_SUPER_OBJECT declaration and so, started to work properly.

I don't know why the UNDEF was hit since it was declared on {$IFDEF MACOS} and I'm not in a MacOS by the way. Please @fabriciocolombo, help us! :)

jhonatasobrinho avatar Mar 07 '16 12:03 jhonatasobrinho

so, you don't have the MACOS directive defined on your project settings? for sure?

RobertoSchneiders avatar Mar 07 '16 13:03 RobertoSchneiders

Yes, I'm sure!

jhonatasobrinho avatar Mar 07 '16 13:03 jhonatasobrinho

Weird. That seems to be a problem with your environment.

RobertoSchneiders avatar Mar 07 '16 13:03 RobertoSchneiders

Are you using the latest version? Before #43, SuperObject was not enabled by default for all environments.

fabriciocolombo avatar Mar 08 '16 12:03 fabriciocolombo

I think so. But I'll download it again and try to reach the problem again.

jhonatasobrinho avatar Mar 08 '16 13:03 jhonatasobrinho