Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread ServerEngineServerSessionEvent ?
Tue, May 31 2011 5:25 AMPermanent Link

IQA

Hi Tim,

Is there an equivalent in TEDBEngine to get the Server details in a TListItem?

For example in DBISAM you might use...

void __fastcall TForm1::DBISAMEngine1ServerConnect(TObject *Sender,
    bool IsEncrypted, const AnsiString ConnectAddress,
    TObject *&UserData)
{

 TListItem *ListItem;

 ListItem = ListView1->Items->Add();
 ListItem->Caption = ConnectAddress;
 ListItem->SubItems->Add("N/A");
 UserData = ListItem;
}
//---------------------------------------------------------------------------

Any ideas for something with TEDBEngine, I'm sure I'd have to use:

ServerEngineServerSessionEvent(TObject *Sender, TEDBServerSessionEventType EventType, const TEDBServerSession &Session, TObject *&UserObject)

But how to assign the list to it is the question.

Thanks,

Phil.
Tue, May 31 2011 5:37 AMPermanent Link

IQA

void __fastcall TMain::ServerEngineServerSessionEvent(TObject *Sender, TEDBServerSessionEventType EventType, const TEDBServerSession &Session, TObject *&UserObject)

{
   /*
    enum TEDBServerSessionEventType { seOpen, seConnect, seLogin, seLogout, seDisconnect, seClose }
    */

   TListItem *ListItem;

   if (EventType == Edbsocket::seConnect)
   {
      ListItem = SessionsListView->Items->Add();

      ListItem->Caption = Session.ID;
      ListItem->SubItems->Add(Session.Address);
      ListItem->SubItems->Add(Session.Description);
      ListItem->SubItems->Add(DateTimeToStr(Now()));
      UserObject = ListItem;
   }
}
Tue, May 31 2011 4:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Philip,

Only one change:

if (EventType == Edbcomps::seConnect)  <<<<<<<<<<<< Here

the enumeration is declared in the edbcomps header, not the edbsocket
header.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, May 31 2011 9:28 PMPermanent Link

IQA

Hi Tim,

I had to use 'Edbcomps::seConnect' for that line (not for any others I added like seDisconnect) cause that particular one conflicted with a 3rd party component, so I had to differentiate it.

Also the enum section at the top was just in a comment tag so I could easily see the options.

Cheers,

Phil.
Image