You won't get hwnd by constructing from new ActiveXObject since your CComControl::CreateControlWindow() is only called during in-place activation, and javascript simply does not have the type system to support the COM interfaces required for in-place activation.
If your control is going to be used as a UI-less COM server (like here in your script) design your ActiveX to work without a window handle.