What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Code snippet crashing messenger

Code snippet crashing messenger
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. Huh?  Code snippet crashing messenger
whenever the following code I have here is executed, and the HTTP response is not '0', messenger will crash. The first dialog box will open, I click OK, and messenger 'encounters a problem and needs to close'. And, it is sorry for any inconvenience.

So, after "Interop.Call("User32", "MessageBoxW", 0, "1There was a problem..." is executed and closed, messenger crashes. Whats going on here?!

code:
if (ControlId == 'BtnDelete' && activeiid==null){
    var response = Interop.Call("User32", "MessageBoxW", 0, "Are you SURE you want to delete this image?\nOnce deleted, it cannot be recovered.", 'YASS', 1);
    if (response == 1){
        var i = 0;
        while(!(Wnd.LstView_GetSelectedState('LVimagelst', i)))
            i++;
        var sBoundary = randomString(10);
        var mpform = new multipartform(sBoundary);
        mpform.addfield('req', 'imgdelete');
        mpform.addfield('iid', i);
        mpform.addfield(yass.fields.MSNid, Messenger.MyUserId);
        mpform.addfield(yass.fields.Password, yass.config.Pass);
        var sPost = mpform.buildmessage();
        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        xmlhttp.open("POST", yass.config.URL, false);
        xmlhttp.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + sBoundary);
        xmlhttp.onreadystatechange = function(){
            if(xmlhttp.readyState == 4) {
                wnd.close(0);
                if(xmlhttp.status == 200) {
                    if (xmlhttp.responseText != 0){
                        Interop.Call("User32", "MessageBoxW", 0, "1There was a problem when trying to complete your request. Please try again later. \nIf this continues, please contact your YASS admin for assistance.", 'YASS', 0);
                    }else{
                        wnd.close(0);
                        OnEvent_MenuClicked('image', 'foo', 'bar')
                    }
                }else{
                    Interop.Call("User32", "MessageBoxW", 0, "2There was a problem when trying to complete your request. Please try again later. \nIf this continues, please contact your YASS admin for assistance.", 'YASS', 0);
                }
            }
        }
        xmlhttp.send(sPost);
    }
}

EDIT: well, commenting the line in question so that is does not execute, stops messenger from crashing, so it has something to do with running the dialog box...

This post was edited on 11-22-2007 at 04:00 PM by MeEtc.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
11-22-2007 03:50 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Code snippet crashing messenger - by MeEtc on 11-22-2007 at 03:50 PM
RE: Code snippet crashing messenger - by vikke on 11-22-2007 at 04:06 PM
RE: Code snippet crashing messenger - by MeEtc on 11-22-2007 at 04:19 PM
RE: Code snippet crashing messenger - by Matti on 11-22-2007 at 05:35 PM
RE: Code snippet crashing messenger - by MeEtc on 11-22-2007 at 05:54 PM


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