Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Use CreateObject()

Here's some sample code using the WinHTTP COM object, showing

On Error Goto WinHTTP51_Error
Set http = CreateObject("WinHTTP.WinHTTPRequest.5.1")
Goto Continue_WinHTTP

WinHTTP51_Error:
' failed creating WinHTTP 5.1 object, so try WinHTTP 5.0
Resume Try_WinHTTP50

Try_WinHTTP50:
On Error Goto WinHTTP5_Error
Set http = CreateObject("WinHTTP.WinHTTPRequest.5")
On Error Goto 0

Continue_WinHTTP:

On Error Goto HTTP_Error

' Make an HTTP request to get the XML from the remote server

temp = http.Open("GET", theURL, False)
Call http.Send()
statusNum = http.status
statusText = http.statusText
getXml = http.responseText
Exit Function

HTTP_Error:
errmsg = "HTTP Error: " + Cstr(Err()) + " " + Error(Err()) + " URL: " + theURL
Print errmsg
getXML = ""
Resume Bail

WinHTTP5_Error:
' had a problem with WinHTTP COM object - assume no access
errmsg = "WinHTTP Error: " + Cstr(Err()) + " " + Error(Err()) + " URL: " + theURL
Print errmsg
getXML = ""
Resume bail


Bail:
Exit Function


Feedback response number WEBB8WUU9P created by ~Ned Nimfanakonyoopsi on 08/04/2012

How to call COM component method in... (~George Nonfree... 4.Aug.12)
. . Use CreateObject() (~Ned Nimfanakon... 4.Aug.12)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS