Page 1 of 1

internet IP (plz translate)

Posted: Sat Oct 28, 2006 9:32 am
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)

Re: internet IP (plz translate)

Posted: Sat Oct 28, 2006 11:52 am
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

Posted: Tue Oct 31, 2006 7:28 pm
by tnhoe
Thanks. Can get Harbour version ?

Posted: Tue Oct 31, 2006 7:31 pm
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

Posted: Sat Nov 04, 2006 5:32 pm
by tnhoe
where can I download hbole.lib ?

Posted: Sat Nov 04, 2006 5:35 pm
by Enrico Maria Giordano
Sent to your private email.

EMG

Posted: Sun Nov 05, 2006 4:03 am
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

Posted: Sun Nov 05, 2006 9:37 am
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