TIWCallbackProc3/TIWCallbackProc4

<< Click to Display Table of Contents >>

Navigation:  Forum >

TIWCallbackProc3/TIWCallbackProc4

Forum link

 

 

 


 

10-10-2024, 11:51 AM:

 

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

 

 

 


 

10-16-2024, 05:34 PM:

 

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