I am trying to serialize into a readable text the parameters (structures) that arrive into my services when some error occurs, and I saw the function SaveObjectToJsonStream in the uROJSONUtils unit, which sounds exactly what I need.
But I haven’t been able to use it. I always get an Access Violation when trying to use it, no matter the object passed to the function. I am calling it from C++Builder, so I don’t know if that’s maybe some of the problem?
I ran a grep on the RO units to see if it’s being used anywhere and couldn’t find anything except the declaration/definition on said unit. So I wonder if it’s being used anywhere, by anybody?
I think the problem here is some incompatibility with C++Builder. I made a simple test case in C++ that attempts to serialize a TForm using this function, and it fails exactly the same as when trying to serialize a RO structure.
But the same thing works in a Delphi project.
I don’t have RO compiled with debug info, so I haven’t been able to debug and at least try to see where this is failing. I’ll see if I can make some time to try this next week.
Meanwhile: my objective here is being able to log the structure/params sent to a service in case some error happens. Is there any other function on RO that would help in this case? I mean, to serialize a ROComplexType derived class to text. The format is not really important (although I was happy with the idea of having JSON).
That’s great! I’ll try adding this functions and see if that solves my issue, but I guess it will work just fine. Thanks!
Edit: I tried the properties you mentioned and they give me the info I need. So that solves my original issue.
In any case, if you can please comment on how to enable debug info for RO so I can try to workaround the AV with the JSON serializer, that would be great.
I was thinking more about compiling the units/packages with debug info enabled. It appears they are not, at least here in my installation, as I can’t “step into” the unit when debugging. I don’t know if there is a global define/setting to enable and re-run install_RO.cmd, or I have to modify the projects directly?