What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] SendMessage Problem

[?] SendMessage Problem
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. Huh?  [?] SendMessage Problem
I'm passing the ChatWnd and Message params from the OnEvent_ChatWndSendMessage event to my own custom function. The reason for this is because it uses an xml request and if I just returned the values, it returns to late and the message had already sent. So I'm using the ChatWnd.SendMessage function to send a message to the same window that calledthe function. I'm using:
code:
Debug.Trace(ChatWnd.SendMessage(Message));
which returns true. It doesn't seem to be adding anything to the chat window however.

Any ideas?
<Eljay> "Problems encountered: shit blew up" :zippy:
11-27-2006 02:02 PM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] SendMessage Problem
Works fine for me [Image: xso_undecided.gif]
code:
function OnEvent_ChatWndSendMessage(Wnd, Msg){
Debug.Trace(Wnd.SendMessage("Bleh"))
}
Traces true and even send the message.
11-27-2006 02:15 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [?] SendMessage Problem
SpunkyLoveMuff,

provide all the code you use in cases like this. Most likely this is a bug in your coding, not in Plus!.

Because:
quote:
Originally posted by SpunkyLoveMuff
I'm passing the ChatWnd and Message params from the OnEvent_ChatWndSendMessage event to my own custom function. The reason for this is because it uses an xml request and if I just returned the values, it returns to late and the message had already sent.
Indicates that you don't have coded this properly since a function will not return automatically on its own before every statement has been executed. Same goes for Plus! events which are nothing more than functions containing statements.

aka: you can simply put your xml request into the event too, it will not make any difference; the event will not return until you return something with code. And thus the actual message will not change or be shown until you return from the event (logically, because otherwise Plus! doesn't have clue what to do, changing the message, discarding the message, showing the message, etc).

This post was edited on 11-27-2006 at 04:47 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-27-2006 04:42 PM
Profile PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
O.P. RE: [?] SendMessage Problem
I have managed to fix this now. It's because the ChatWnd.SendMessage function was sending the data back to OnEvent_ChatWndSendMessage and then the code would loop again, but return ""...
<Eljay> "Problems encountered: shit blew up" :zippy:
11-27-2006 04:50 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [?] SendMessage Problem
quote:
Originally posted by SpunkyLoveMuff
I have managed to fix this now. It's because the ChatWnd.SendMessage function was sending the data back to OnEvent_ChatWndSendMessage and then the code would loop again, but return ""...
I see... though the ChatWnd.SendMessage function doesn't send anything back. It sends data to the chatwindow, probably triggering another OnEvent_ChatWndSendMessage, and that is what looped.

1) OnEvent_ChatWndSendMessage is triggered (A)
2)    you perform somewhere in that function an ChatWnd.SendMessage
3)    Another OnEvent_ChatWndSendMessage is triggered (B)
4)    OnEvent_ChatWndSendMessage (B) is ended and returns
5) OnEvent_ChatWndSendMessage (A) is ended and returns

As you see OnEvent_ChatWndSendMessage (A) isn't finished until all the code/statements which are performed in that function are executed, only then it will finish.

or:

1) OnEvent_ChatWndSendMessage is triggered (A)
2)    you perform somewhere in that function an ChatWnd.SendMessage
3) OnEvent_ChatWndSendMessage (A) is ended and returns
4) Another OnEvent_ChatWndSendMessage is triggered (B)
5) OnEvent_ChatWndSendMessage (B) is ended and returns

Again, no function or event will finish when all statements inside that function are finished.

This post was edited on 11-27-2006 at 08:27 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-27-2006 08:22 PM
Profile PM Find Quote Report
« 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