What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Question] Any way I can get a Winsock ActiveXObject working ?

Pages: (3): « First [ 1 ] 2 3 » Last »
[Question] Any way I can get a Winsock ActiveXObject working ?
Author: Message:
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
O.P. [Question] Any way I can get a Winsock ActiveXObject working ?
If it's possible, which one ?

Thanks :P
06-06-2006 10:04 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
In my webserver script i was working on i used

code:
new ActiveXObject( "MSWinsock.Winsock.1" );

[Image: dt2.0v2.png]      Happy Birthday, WDZ
06-06-2006 10:19 AM
Profile PM Web Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
O.P. RE: [Question] Any way I can get a Winsock ActiveXObject working ?
Doesn't seem to work here |:

code:
function Test()
{
var ws = new ActiveXObject( "MSWinsock.Winsock.1" );
return 'abc';
}
doesn't return anything


code:
function Test()
{
//var ws = new ActiveXObject( "MSWinsock.Winsock.1" );
return 'abc';
}
returns 'abc'

Any ideas ? |:
06-06-2006 05:46 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
quote:
Originally posted by Pai
Doesn't seem to work here |:

code:
function Test()
{
var ws = new ActiveXObject( "MSWinsock.Winsock.1" );
return 'abc';
}
doesn't return anything


code:
function Test()
{
//var ws = new ActiveXObject( "MSWinsock.Winsock.1" );
return 'abc';
}
returns 'abc'

Any ideas ? |:
Well when you use return "abc" your saying the return value of the function is "abc".

How about trying this :
code:

function Test(){
    var ws = new ActiveXObject( "MSWinsock.Winsock.1" );
    return ws.LocalIP;
}

06-06-2006 07:25 PM
Profile E-Mail PM Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
O.P. RE: [Question] Any way I can get a Winsock ActiveXObject working ?
Yes you are right, but my point was that "something wrong" happened when I declared the new ActiveXObject, stoping the function so that it didn't reach the line to return something.

I've tried that return ws.LocalIP in the past and also didn't work (and obviously I just retried it to make sure), making me believe that "MSWinsock.Winsock.1" isn't a valid ActiveXObject, at least in my pc :(
06-06-2006 11:27 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
Indeed not everyone has "MSWinsock.Winsock.1". Thus:

quote:
Originally posted by -dt-
In my webserver script i was working on i used
code:
new ActiveXObject( "MSWinsock.Winsock.1" );

Never use the "blahblah.1", "blahblah.2", "blahblah.3", etc objects. Not everybody has them.

The ".x" indicates that there are multiple versions registered on your computer (which may on its turn indicate duplicated, even corrupted objects).

When you omit the ".x", the default one is loaded instead (as that is its proper name; thus without that ".x"). And if present, the system will search for the latest (or not corrupted) version on its own.

Note1: This goes for all ActiveX objects, not just for "MSWinsock.Winsock".

Note2: When you use non standard ActiveX objects, or objects which depend on other possibly not installed stuff, always check if they exist on the hosts computer. Don't automatically assume that everybody has them.

This post was edited on 06-07-2006 at 12:46 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-07-2006 12:41 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
True, however, remember that Messenger Plus! Live cannot run on anything below Windows XP, this means that you can happily use any object that comes with XP without worrying about backward compatibility (just make sure you don't use objects installed by the SP2 or make sure your script displays appropriate errors to the user).
[Image: signature2.gif]
06-07-2006 03:39 AM
Profile PM Web Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
38 / Male / Flag
Joined: Aug 2004
Status: Away
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
Well, Winsock without the .1 doesn't work with me either. [Image: xso_undecided.gif]

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

06-07-2006 04:51 AM
Profile PM Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
O.P. RE: [Question] Any way I can get a Winsock ActiveXObject working ?
I appreciate everyone's explanation, but before I started this topic I googled a bit (ok a lot) and found a couple of Winsock ActiveXObjects ("OSWINSCK.Winsock" and "MSWinsock.Winsock") which I have tried and didn't work, so "MSWinsock.Winsock" didn't work for me either :(

After debugging my script, I found an interesting thing:

» when I use ActiveXObject "MSWinsock.Winsock" or "MSWinsock.Winsock.1", I get in the debugger
code:
Error: unknown.
       Line: 128. Code: -2147221230.

» when I use ActiveXObject "MSWinsock.Winsock.x", I get error
code:
Error: The Automation server can't create the object.
       Line: 128. Code: -2146827859.

So, I *should* be able to use that but my PC can't create it ?

PS: The debugger text was translated back to english as close as I can get, because it was in Portuguese, so it might not be as accurate as the proper english text.

edit:

PS2: How can I find out for sure what ActiveXObjects I have installed in my system ? Or a way to find out which Objects I have, because I'm starting to think that something went wrong when I installed XP and the winsock object didn't got installed :X

This post was edited on 06-07-2006 at 06:47 AM by Pai.
06-07-2006 06:43 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [Question] Any way I can get a Winsock ActiveXObject working ?
quote:
Originally posted by Pai
PS2: How can I find out for sure what ActiveXObjects I have installed in my system ? Or a way to find out which Objects I have, because I'm starting to think that something went wrong when I installed XP and the winsock object didn't got installed :X
I use ActiveX manager
[Image: dt2.0v2.png]      Happy Birthday, WDZ
06-07-2006 06:52 AM
Profile PM Web Find Quote Report
Pages: (3): « First [ 1 ] 2 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On