Quantcast
Channel: Atozed Forums - All Forums
Viewing all articles
Browse latest Browse all 275

TIWCallbackProc3/TIWCallbackProc4

$
0
0
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()-&tWebApplication-&tResponse-&tCode = 200;
aHandled = true;

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

class TChatCallbackRef : public TCppInterfacedObject&tTIWCallbackProc3&t
{
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

Viewing all articles
Browse latest Browse all 275

Trending Articles