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...