Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312

    StatusDlg and HTTP.TestConnection

    Hi all,

    I want to show the StatusDlg window while checking a Website but it doesn't work. It seems that the action HTTP.TestConnection() stops all other actions.
    Is there another way to show the Status while checking the internet?

    Button [On Click]
    CheckAdress="ww1.copadata.at"

    _meter=0;
    StatusDlg.SetMeterRange(0, 100);
    StatusDlg.Show(MB_ICONNONE, false);
    Page.StartTimer(200);

    result = HTTP.TestConnection(CheckAdress, 20, 80, nil, nil);

    StatusDlg.Hide();
    Page.StopTimer();


    Page [On Timer]
    _meter=_meter+1;
    StatusDlg.SetMeterPos(_meter);



    Stefan

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Hi Stefan,

    This probably gets a little deep, but when checking a connection, there really is no "meter" (I see what you're trying to do). The site is either live or it's not. There's no 0 to 100 to really count.

    My suggestion would be maybe an animated dialog (flash or whatever - a computer connect type animation?) that just ticks away until the the connection takes. My 2.5 cents.

  3. #3
    Join Date
    Jun 2002
    Posts
    42
    Hi Stefan,

    No help i am afraid, but I too have the same issue as you. You can specify the number of seconds to try the TestConnection for, but have no way of representing the progress through this time (the AMS app is essentially frozen).

    I guess Ron's idea coupled with an embedded object would work, but I don't want to use Flash in my app, and we have no animated gif support for the time being.

  4. #4
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    I actually played with this for a while today and I couldn't get an object to appear with a "live" site (had to make the site invalid). It connected fine every single time and the object just "flashed" (poor term of words) at best.

    If the site you're trying to connect to is "not reliable", then how's about a workaround. Maybe place a file on the site to download (say, to a temp directory or whatever - ehhh, 100k) and that would give the user an indication that a process is happening and you could use a regular dialog for that. Then, you could put a condition there if the file doesn't download in 'n' seconds or whatever. I think that's what you're looking for. Kinda cheezy way of doing it, but it would give the user a sort of feedback, if that's what you're looking for.

    It's proabably why IR didn't put a progress feedback option on that because the connection is either there or it isn't. Is there something else that you're trying to do here?

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Let me know (if you use this) if this section of code will help (thank you):


    PHP Code:
    -- Web Site to check against

    CheckAdress 
    "http://www.cnn.com"


    -- Standby message -- so that the user has something to view while they wait

    Dialog
    .TimedMessage("Connecton Status. . .""Testing for an Internet Connection.  Standby...\r\n           (up to 20 seconds to process)"5000MB_ICONINFORMATION);


    -- 
    Actual checking for an active Internet connection

    result 
    HTTP.TestConnection(CheckAdress2080nilnil);
        
    err Application.GetLastError();             -- Error handling begin
            
    if err ~= 0 then
                Dialog
    .Message("Error: "err);        -- Error handling end
            
    else
            

    -- 
    Response back to the user wether there was an active connection to the Internet or not

        
    if result then
            Dialog
    .TimedMessage("Connection Status. . .""Success!  Internet connection verified, continuing."3500MB_ICONEXCLAMATION);
        else
            
    Dialog.Message("Connection Status. . .""Failure!  Internet connection not found!\r\nPlease connect to the Internet and try again!"MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
        
    end
            end 
    [Edit] - Changed one MB_INFOICON from informational one to exclamation and took out an apparently runaway "--" (comment) at the end of a line of code (grin)[End of Edit]
    Intrigued

  6. #6
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    Thanks for your answers.

    Intrigued the code works fine.



    Stefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts