Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reference a .dll file with attachmate?????

Status
Not open for further replies.

nrm3

Technical User
Jan 26, 2009
12
US
I am trying to send data to a HTTP server from within a Extra script.I need to reference "Microsoft WinHTTP Services winhttp.dll)"
I want to be able to access the the WinHTTP WinHttpRequest COM object.

When I compile the script below ,it errors at ( Set HttpReq = New WinHttpRequest )
The error = ‘WinHttpRequest’ is not a class

I know I need to reference winhttp.dll in a declare sub statement but I am not sure of the syntax.

Declare Sub name [libSpecification] [(parameter[As type][,...])]

Does anyone have any ideas?
=======================================================

Sub
Dim HttpReq As Object
Dim strTo As String
Dim strFrom As String
Dim strUserMessage As String
Dim strXmlMsg As String

strTo = "ab5835"
strFrom = "test.bot"

strUserMessage = "This is a test message”

strXmlMsg = "xmlMessage=<message type=""contact.send.message"" id=""" & strFrom
strXmlMsg = strXmlMsg & """ contactId=""" & strTo
strXmlMsg = strXmlMsg & """><statement from=""" & strFrom
strXmlMsg = strXmlMsg & """ to=""" & strTo
strXmlMsg = strXmlMsg & """ text=""" & strUserMessage
strXmlMsg = strXmlMsg & """/></message>"

' Initialize the WinHTTPRequest Object.
* Set HttpReq = New WinHttpRequest
HttpReq.Open "GET", " & strXmlMsg, False


' Send data to the HTTP server.
HttpReq.Send

'Cleanup
Set HttpReq = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top