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

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.



Fri, 16 May 2003 03:00:00 GMT  
 I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta


Fri, 19 Jun 1992 00:00:00 GMT  
 I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta

Quote:

>    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/



Fri, 16 May 2003 03:00:00 GMT  
 I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta


Fri, 19 Jun 1992 00:00:00 GMT  
 I cannot use WScript.CreateObject("MSWinsock.Winsock","Tcp1_") in .hta
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
--

Please do not email questions - post them to the newsgroup...
--


Quote:
> 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.



Fri, 16 May 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CreateObject("Excel","//server"), MsgBox output

2. CreateObject("Excel","//server"), MsgBox output

3. Set WSHShell = WScript.CreateObject("WScript.Shell")

4. "Cannot load """

5. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

6. Cannot "CreateObject" with Script Control

7. can't CreateObject("Wscript.Shell")

8. Set WshShell = CreateObject("WScript.Shell")

9. Disabling "BACK"/"FORWARD" buttons

10. Problem With "window.showmodaldialog("")"

11. Disabling "BACK"/"FORWARD" buttons

12. Using &quot;CreateObject&quot;

 

 
Powered by phpBB® Forum Software