TIpClientHttp():New

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

TIpClientHttp():New

Post by Colin Haig »

Hi All

I am trying to get this to work with Harbour and Microsoft Compiler - I have searched back through
old threads and seen other people have had problems with Harbour. Can anyone tell me what libs etc to
link in to make this work.

Thanks to Antonio in convincing me to swap to harbour - I have converted a couple of apps now and I am
very happy with the results.

Cheers

Colin
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: TIpClientHttp():New

Post by lucasdebeltran »

Colin,

This is a simple that Works fine:

Code: Select all

  
FUNCTION MAIN()

      LOCAL oHttp, cHtml, hQuery

       oHttp:= TIpClientHttp():new( "http://www.google.de/search" )

       // build the Google query
       hQUery := Hash()
       hSetCaseMatch( hQuery, .F. )

       hQuery["q"]    := "xHarbour"
       hQuery["hl"]   := "en"
       hQuery["btnG"] := "Google+Search"

       // add query data to the TUrl object
       oHttp:oUrl:addGetForm( hQuery )

       // Connect to the HTTP server
       IF oHttp:open()
          // downlowad the Google response
          cHtml   := oHttp:readAll()
          Memowrit( "Google_xHarbour.html", cHtml )

          oHttp:close()
          ? Len(cHtml), "bytes received "
          ?? "and written to file Google_xHarbour.html"
       ELSE
          ? "Connection error:", oHttp:lastErrorMessage()
       ENDIF
    RETURN
 
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: TIpClientHttp():New

Post by Colin Haig »

Hi Lucas

I added echo $(HBDIR)\lib\hbtip.lib >> msvc.tmp to my .mak and tried to compile that example but get the following error -

hbrtl.lib(hbsocket.obj) : error LNK2019: unresolved external symbol __imp__WSAIoctl@36 referenced in function _hb_socketGetIFaces

I am using Harbour 3.2.0dev (r1310011443) and Microsoft compiler VS2010

Cheers

Colin
Post Reply