internet IP (plz translate)

Post Reply
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

internet IP (plz translate)

Post by tnhoe »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: internet IP (plz translate)

Post by Enrico Maria Giordano »

This is a working sample in pure xHarbour:

Code: Select all

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
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

Thanks. Can get Harbour version ?
Regards

Hoe, email: easywin3@yahoo.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Here it is (please note that you need of hbole.lib):

Code: Select all

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
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

where can I download hbole.lib ?
Regards

Hoe, email: easywin3@yahoo.com
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

EMG
Post Reply