Atozed Forums
TIWCallbackProc3/TIWCallbackProc4 - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: TIWCallbackProc3/TIWCallbackProc4 (/thread-4581.html)



TIWCallbackProc3/TIWCallbackProc4 - JuergenS - 10-10-2024

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


RE: TIWCallbackProc3/TIWCallbackProc4 - JuergenS - 10-16-2024

Hi

IW15.6.7

When comparing Pascal source code and C++ header files, I found that
the shipped callback interface specifications in IWCallBackFunc.hpp do not match the specifications of the source code in IWCallBackFunc.pas.

The file IWCallBackFunc.pas is inconsistent overall.

Regards
Juergen