Looking further, the TROAsyncProxy defines that functions, so it seems it shouldn’t produce those compiler errors, but I haven’t found a way to workaround them.
these lines aren’t accepted:
#include "%UNIT_NAME%_Async.h"
#ifndef %UNIT_NAME%_AsyncH
#define %UNIT_NAME%_AsyncH
I can’t reproduce this problem.
this code:
//test usual call
_di_INewService aaa1 = CoNewService::Create(ROMessage,ROChannel);
AnsiString r1 = aaa1->NewMethod("test");
//test async call
_di_INewService_Async aaa = CoNewService_Async::Create(ROMessage,ROChannel);
aaa->Invoke_NewMethod("test");
if (!aaa->AnswerReceived) Sleep(1000);
AnsiString r2 = aaa->Retrieve_NewMethod();
compiled successfully.
Looks like you forgot to regenerate _async files, because I had that error before #71225 was fixed.
Hello,
The changes to the aync templates are indeed not needed. I noticed that the SB creates the units without the _async in the code, no matter what name you gave the unit when saving, but generating on the IDE seems to work fine.
About the compilation problems:
That error only happens if you apply the other change I mentioned: adding the Interface of the service as an ancestor to the Proxy class. Without those changes then you can compile fine the units, but you can’t use the code, as trying to create the service proxy fails with the exception mentioned earlier. That is what I was trying to solve when adding the Interface, and when doing so I found this other error. I did rebuild the _Asnyc units (actually the IDE did that for me, at some point it started generating them when building).
can you show, what _Async.h IDE was generated for you?
you can attach it here or send to support@
Sure, sent by email at support@
bugs://71225 got reopened.
try this one:
Templates.zip (40.5 KB)
now it should be fixed.
bugs://71225 got closed with status fixed.
Thank you, I will try this ASAP.
There is still a little problem. With complex types, the templates are missing the & operator when reading from the message (in the Retrieve_ method).
I’m attaching here the modified unit.
template.async.cpp.zip (1.3 KB)
With this I managed to implement finally an async call, so I hope/expect everything is now finally working.
Thanks!