FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour internet IP (plz translate)
Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
internet IP (plz translate)
Posted: Sat Oct 28, 2006 09:32 AM

Following is Visual Foxpro code to get internet IP.

Anyone can help to translate it to FWH plz :-

loExplorer = CreateObject("InternetExplorer.Application")
loExplorer.Navigate2("www.whatismyip.com")
DO WHILE loExplorer.readystate <> 4
ENDDO
loDoc = loExplorer.Document
cIp = UPPER(loDoc.Body.Innertext)

Regards

Hoe, email: easywin3@yahoo.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: internet IP (plz translate)
Posted: Sat Oct 28, 2006 11:52 AM
This is a working sample in pure xHarbour:

FUNCTION MAIN()

    LOCAL oExplorer := CREATEOBJECT( "InternetExplorer.Application" )

    oExplorer:Navigate2( "www.whatismyip.com" )

    WHILE oExplorer:ReadyState <> 4
        HB_IDLESLEEP( 1 )
    ENDDO

    ? UPPER( oExplorer:Document:Body:InnerText )

    oExplorer:Quit()

    INKEY( 0 )

    RETURN NIL


EMG
Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
internet IP (plz translate)
Posted: Tue Oct 31, 2006 07:28 PM

Thanks. Can get Harbour version ?

Regards

Hoe, email: easywin3@yahoo.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
internet IP (plz translate)
Posted: Tue Oct 31, 2006 07:31 PM
Here it is (please note that you need of hbole.lib):

FUNCTION MAIN()

    LOCAL oExplorer := TOleAuto():New( "InternetExplorer.Application" )

    oExplorer:Navigate2( "www.whatismyip.com" )

    WHILE oExplorer:ReadyState <> 4
        HB_IDLESLEEP( 1 )
    ENDDO

    ? UPPER( oExplorer:Document:Body:InnerText )

    oExplorer:Quit()

    INKEY( 0 )

    RETURN NIL


EMG
Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
internet IP (plz translate)
Posted: Sat Nov 04, 2006 05:32 PM

where can I download hbole.lib ?

Regards

Hoe, email: easywin3@yahoo.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
internet IP (plz translate)
Posted: Sat Nov 04, 2006 05:35 PM

Sent to your private email.

EMG

Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
internet IP (plz translate)
Posted: Sun Nov 05, 2006 04:03 AM

Thanks, got it.

But after link got this error when running BUILDH.BAT :

Error: Unresolved external '_hb_vmMessage' referenced from HBOLE.LIB|ole2

Regards

Hoe, email: easywin3@yahoo.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
internet IP (plz translate)
Posted: Sun Nov 05, 2006 09:37 AM

Sorry, it seems that your Harbour version is too old and I have no way to build a hbole.lib compatible with it.

EMG

Continue the discussion