Page 1 of 1

TIpClientHttp():New

PostPosted: Tue Jun 24, 2014 4:42 am
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

Re: TIpClientHttp():New

PostPosted: Tue Jun 24, 2014 12:26 pm
by lucasdebeltran
Colin,

This is a simple that Works fine:

Code: Select all  Expand view
 
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
 

Re: TIpClientHttp():New

PostPosted: Tue Jun 24, 2014 1:03 pm
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