Shoutbox

ChatWnd contains no properties or methods - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: ChatWnd contains no properties or methods (/showthread.php?tid=83641)

ChatWnd contains no properties or methods by Jeroen Noten on 05-10-2008 at 11:22 AM

(I'm Dutch, sorry for my bad English.)

Hello everybody,

I have a problem with my script. Maybe it's WLM 9, because I have the problems since I installed 9.

The problem:
I have made this script (as a test script):

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
    Debug.Trace(typeof ChatWnd);
    for (i in ChatWnd) {
        Debug.Trace(ChatWnd[i]);
    }
}


When I send a message to somebody or somebody sends a message to me, i get in the debug window:

object

That's all. It means that ChatWnd contains no properties or methods, what I don't understand. Does anyone have a solution or a cause?

Thanks!
RE: ChatWnd contains no properties or methods by Spunky on 05-10-2008 at 07:36 PM

try Debug.Trace(ChatWnd.Handle);

It looks like there are no i in ChatWnd so I'm not sure you can loop it in the same way as arrays and/or some other objects


RE: ChatWnd contains no properties or methods by matty on 05-11-2008 at 01:30 AM

ChatWnd is not an array it is an Object.

Therefore you have to append the properties, you cannot look through them.


RE: ChatWnd contains no properties or methods by Spunky on 05-11-2008 at 08:15 AM

quote:
Originally posted by matty
ChatWnd is not an array it is an Object.

Therefore you have to append the properties, you cannot look through them.

But on an object you create your self you can :p
RE: ChatWnd contains no properties or methods by CookieRevised on 05-12-2008 at 12:21 AM

Yep, but MsgPlus objects aren't like normal objects... There's a difference...

That's also the reason why you can't add your own properties to them (like you can with 'normal' objects).


RE: ChatWnd contains no properties or methods by Matti on 05-12-2008 at 10:47 AM

quote:
Originally posted by CookieRevised
Yep, but MsgPlus objects aren't like normal objects... There's a difference...

That's also the reason why you can't add your own properties to them (like you can with 'normal' objects).
Quoted for truth. It would be much cooler if we could append our own functions to objects like the PlusWnd object (if it was an object). Then, we could make object-oriented things like "PlusWnd.LstView_SetColumn" or "PlusWnd.LstView_Sort" instead of passing the PlusWnd object to a function. We could write some kind of library or framework for Plus! scripts, like the Prototype JS does for the Document Object Model. :)

Aah, think of the possibilities... :P
RE: ChatWnd contains no properties or methods by Jeroen Noten on 06-29-2008 at 09:17 PM

Thanks everybody! (And sorry for my late reply.)