View Full Version : HTA and ActiveXObject - Scripting Events

Mar 4th, 2007, 05:16 PM
I hope it is okay for me to use the Javascript forum for this. I am using Javascript/JScript and HTA rather than VBScript. I am trying to make this javascript work inside a HTA: http://www.winscripter.com/WSH/Internet/79.aspx

I'm using new ActiveXObject rather than the WScript.CreateObject because HTA doesn't have these. Everything works fine.
The problem is, I have no idea how to invoke the 'ConnectionRequest' event.

This Scripting Events (http://msdn2.microsoft.com/en-us/library/ms974564.aspx) documentation specifies the different events available. I have tried the different ways in specifying events without success.

function wsock::ConnectionRequest()
function wsock_ConnectionRequest()
function wsock.ConnectionRequest

var socket = WScript.CreateObject("MSWinsock.Winsock", "wsock_");
I believe the problem is that ActiveXObject does not concatenate a prefix to the event.

How do I call this event?