Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWCallbackProc3/TIWCallbackProc4
#1
Hi,

The following code snipsets i used before IW15.5.0.
See also: ajaxCall in dedicated web worker thread

But actually the response code will always be executed, even if i set:

UserSession()->WebApplication->Response->Code = 200;
aHandled = true;

Does anybody know how to change the C++ code according to the description in the version history ?

class TChatCallbackRef : public TCppInterfacedObject<TIWCallbackProc3>
{
public:
INTFOBJECT_IMPL_IUNKNOWN(TInterfacedObject);

void __fastcall Invoke(TStrings *aParams, UnicodeString &aResult, bool &aHandled)
{
// class method
TIWUM_Frm_ChatA::GetNextItem((TStringList*)aParams, aResult, aHandled);
}
};

RegisterCallBack(_D("GetNextItem"), _di_TIWCallbackProc3(new TChatCallbackRef()));


__classmethod void __fastcall GetNextItem(System::Classes::TStringList *ListParams,
  System::UnicodeString &ListResult,
  bool &aHandled);
   

Version History link 15.5.0
2023-11-22

Modified

Callback infrastructure was refactored due to incompatibilities with FreePascal/Lazarus.
A minor method signature change was necessary in 2 of the callback methods.
The aHandled parameter in TIWCallbackProc3 and TIWCallbackProc4 became “var” parameters instead of “out”.
In case your code uses one of them it is possible that a small adjustment will be necessary.
In that case just change the aHandled parameter from out to var and the application will compile and work as before:

TIWCallbackProc3 = reference to procedure (aParams: TStrings; out aResult: string; var aHandled: Boolean);

TIWCallbackProc4 = reference to procedure (aParams: TStrings; out aResult, aContentType: string; var aHandled: Boolean);


Juergen
Reply


Messages In This Thread
TIWCallbackProc3/TIWCallbackProc4 - by JuergenS - 10-10-2024, 11:51 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)