Re: Connect()

Giganews Newsgroups
Subject: Re: Connect()
Posted by:  Remy Lebeau \(TeamB\) (
Date: Mon, 19 May 2008

"duf" <d…> wrote in message news:8626B1CB3854E340d…

> How to check if there is connection with internet or host ?

You already know how, because you are already doing it.  The only reliable
way is to connect to a known host and see if it succeeds or fails.

> But if there is no connection with internet or mailbox is unreachable
> and I try to connect with my mailbox there is exception like "host not
> found".

There are many different types of errors possible.

> In my programme I would like to have my own message dialogue
> with my own warring and possibility to take decision what to do next.

Then simply pass your own string value to MessageDlg().  You don't have to
use the Exception::Message property if you don't want to.  For example:

    catch(const Exception &)
        MessageDlg("Unable to connect.  Please check your Internet
connection and try again", mtWarning , TMsgDlgButtons() << mbOK, 0);




In response to

Connect() posted by duf on Sat, 17 May 2008