Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta

813 views
Skip to first unread message

Unknown

unread,
Nov 27, 2000, 3:00:00 AM11/27/00
to

In a file .vbs I can use this:
Set TCP1 = WScript.CreateObject("MSWinsock.Winsock","Tcp1_")
but, inside a file .hta (HTML Application) I need to use
Set TCP1 = WScript.CreateObject("MSWinsock.Winsock")

It do not accept the sufix "Tcp1_" then I cannot use the events generated by it.
I need to make my own flow control based on TCP1.state, settimeout(The WScript.Sleep() in not accepted too), etc.


I am using IE 5.5 under Windows 2000.

Can someone help me?
Thanks forward.

Tom Lavedas

unread,
Nov 27, 2000, 3:00:00 AM11/27/00
to
"mar...@caisnet.com.br" wrote:
>
> Part 1.1Type: Plain Text (text/plain)

Wscript is not the host for HTA's, MSHTA.exe is. Therefore, the objects
that are intrinsic to the host, like Wscript.CreateObject and .Sleep are
not available. Try this instead ..

Set TCP1 = CreateObject("MSWinsock.Winsock")
TCP1.eventName = GetRef("TCP1_eventSubName)

You will need one GetRef() statement for each event to be trapped.

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/

Michael Harris

unread,
Nov 27, 2000, 3:00:00 AM11/27/00
to
In HTML (including HTAs), use the standard <OBJECT> tag instead of CreateObject... You can also try
using ScriptX from www.meadroid.com which supports connecting event sinks to sources "after the
fact"...

--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup...
--


"mar...@caisnet.com.br" <IMCEAEX-> wrote in message
news:143C6B82A8F1D211BBC200105A67CEF8202267@JIM...

0 new messages