internet IP (plz translate)

internet IP (plz translate)

Postby tnhoe » Sat Oct 28, 2006 9: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
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia

Re: internet IP (plz translate)

Postby Enrico Maria Giordano » Sat Oct 28, 2006 11:52 am

This is a working sample in pure xHarbour:

Code: Select all  Expand view
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
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby tnhoe » Tue Oct 31, 2006 7:28 pm

Thanks. Can get Harbour version ?
Regards

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

Postby Enrico Maria Giordano » Tue Oct 31, 2006 7:31 pm

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

Code: Select all  Expand view
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
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby tnhoe » Sat Nov 04, 2006 5:32 pm

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

Postby Enrico Maria Giordano » Sat Nov 04, 2006 5:35 pm

Sent to your private email.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby tnhoe » Sun Nov 05, 2006 4: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
User avatar
tnhoe
 
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia

Postby Enrico Maria Giordano » Sun Nov 05, 2006 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests