Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lambda functions with classic 32 bit Borland compiler ?
#11
Thanks for the example, I will give it a try.

Best Regards
Juergen
Reply
#12
Another option for anonymous function callbacks:


//Sample callback structure to pass/fill variables
//---------------------------------------------------------------------------
struct LookUpStruct
{
String *rip,*sts,*lac,*tid,*bnm;

LookUpStruct(String *_rip, String *_sts, String *_lac, String *_tid, String *_bnm) : rip(_rip),sts(_sts),lac(_lac),tid(_tid),bnm(_bnm) { };

void operator()(System::TObject* obj)
{
TIWApplication *ASession = (TIWApplication *)obj;
*rip = ((TIWUserSession*)ASession->Data)->realIP;
*sts = ASession->SessionTimeStamp.FormatString("yyyy-mm-dd hh:nnConfuseds");
*lac = ASession->LastAccess.FormatString("yyyy-mm-dd hh:nnConfuseds");
*tid = IntToStr(ASession->TrackID);
*bnm = ASession->Browser->BrowserName;
}
};
//---------------------------------------------------------------------------
typedef TMethodRef<Iwlfsessionlist::TSessionProc,LookUpStruct,void,System::TObject* > _LookUpStruct;
//---------------------------------------------------------------------------

//Sample callback struct usage
//---------------------------------------------------------------------------
void __fastcall TMJForm::btnRefreshAsyncClick(TObject *Sender, TStringList *EventParams)
{
auto_ptr<TStringList> sl(new TStringList);
gSessions->GetList(sl.get());

String ip,sts,lac,tid,bnm;

for(int i=0;i<sl->Count;i++) {
gSessions->LookUp(sl->Strings[i],new _LookUpStruct(LookUpStruct(&ip,&sts,&lac,&tid,&bnm)));
...
}
}
Reply
#13
I've tried the other example by now and it works fine, but this example is actually closest to what I need.

Thank you for your help
Juergen
Reply
#14
I changed everything according to the last example and it works fine.

Thanks again for your help.
Juergen
Reply
#15
Thanks for the follow up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)