SiliconShadow
New Member
Posts: 6
Joined: Apr 2010
|
O.P. RE: JIT - Debug popups
Sorry I didn't check back after a couple of days and just looked again today, so I am again sorry for resurrecting this issues.
To add some things:
I do now have any extensions installed
I have not made anything myself for this
This is just with Messenger Plus installed ontop of my MSN nothing else
I cannot edit that line or I would of done that already
Example of receiving the error: Start msn with Messenger Plus installed, Exit the program, Receive Runtime error:
---------------------------
Microsoft Development Environment
---------------------------
An exception of type 'Microsoft JScript runtime error: 'Wnd' is null or not an object' was not handled.
---------------------------
OK
---------------------------
This error doesn't happen with Messenger Plus installed, however it is just annoying but I am hoping there is a proper fix.
The code from the file:
Notes: var WnD is initialised, the error is on line 40 code: var Wnd;
function OnGetScriptMenu(Location)
{
var ScriptMenu = "<ScriptMenu>";
ScriptMenu += "<MenuEntry Id=\"MnuStart\">Edit Name</MenuEntry>";
ScriptMenu += "</ScriptMenu>";
return ScriptMenu;
}
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
if(MenuItemId == "MnuStart")
{
Wnd = MsgPlus.CreateWnd("NameEditor.xml", "WndMain");
Wnd.SetControlText("NameEdit", Messenger.MyName);
Wnd.SetControlText("NameEditPreview", Messenger.MyName);
Wnd.SendControlMessage('NameEdit', 0xC5, 129, 0);
Wnd.Combo_AddItem("NamePm", "Name");
Wnd.Combo_AddItem("NamePm", "Personal Message");
Wnd.Combo_SetCurSel("NamePm", 0);
//Wnd.ImageElmt_SetImageFile("emoticon", "WLM_1");
var len = Wnd.GetControlText("NameEdit").length;
var EM_SETSEL = 0xB1;
Interop.Call("user32","SetFocus", Wnd.GetControlHandle("NameEdit"));
Interop.Call("user32","SendMessageW", Wnd.GetControlHandle("NameEdit"), EM_SETSEL, len, len);
}
}
function OnWndMainEvent_ComboSelChanged()
{
if(Wnd.Combo_GetCurSel("NamePm") == 0)
Wnd.SetControlText("NameEdit", Messenger.MyName);
else
Wnd.SetControlText("NameEdit", Messenger.MyPersonalMessage);
}
function OnEvent_Uninitialize(MessengerExit)
{
/*******************
* The error is here
*******************/
Wnd.Close();
}
function OnWndMainEvent_CtrlClicked(Wnd, ControlId)
{
// Two Win32 Messages that we will need to send later
var EM_GETSEL = 0xB0;
var EM_SETSEL = 0xB1;
// Allocate some memory for the cursor index
var Start = Interop.Allocate(4);
// Number of characters to move the cursor on by later
var numCharsAdded = 1;
// Get where the cursor is in the input box
Interop.Call("user32", "SendMessageW", Wnd.GetControlHandle("NameEdit"), EM_GETSEL, Start, 0);
// Split the string into two parts on either side of the cursor so we can insert characters in the middle
var text = Wnd.GetControlText("NameEdit");
var firstHalf = text.substring(0, Start.ReadDWORD(0));
var secondHalf = text.substring(Start.ReadDWORD(0), text.length);
// Insert format codes when the format buttons are pressed
if(ControlId == "BtnBold")
{
Wnd.SetControlText("NameEdit", firstHalf + "·#" + secondHalf);
numCharsAdded = 2;
}
if(ControlId == "BtnUnderline")
{
Wnd.SetControlText("NameEdit", firstHalf + "·@" + secondHalf);
numCharsAdded = 2;
}
if(ControlId == "BtnItalic")
{
Wnd.SetControlText("NameEdit", firstHalf + "·&" + secondHalf);
numCharsAdded = 2;
}
if(ControlId == "BtnStrikethrough")
{
Wnd.SetControlText("NameEdit", firstHalf + "·'" + secondHalf);
numCharsAdded = 2;
}
if(ControlId == "BtnColour")
{
var CHOOSECOLOR = Interop.Allocate(36);
CHOOSECOLOR.WriteDWORD(0, 36); //DWORD lStructSize
CHOOSECOLOR.WriteDWORD(4, 0); //HWND hwndOwner
CHOOSECOLOR.WriteDWORD(8, 0); //HWND hInstance
CHOOSECOLOR.WriteDWORD(12, 0x000000FF); //COLORREF rgbResult (COLORREF = 0x00bbggrr)
var CustColors = Interop.Allocate(64); //Create an array of 16 COLORREFs for CustColors
CHOOSECOLOR.WriteDWORD(16, CustColors.DataPtr); //COLORREF *lpCustColors (pointer to our array)
CHOOSECOLOR.WriteDWORD(20, 3); //DWORD Flags (3 = 2 (CC_FULLOPEN) + 1 (CC_RGBINIT) )
CHOOSECOLOR.WriteDWORD(24, 0); //LPARAM lCustData
CHOOSECOLOR.WriteDWORD(28, 0); //LPCCHOOKPROC lpfnHook
CHOOSECOLOR.WriteDWORD(32, 0); //LPCTSTR lpTemplateName
//Open the dialog box
var result = Interop.Call('comdlg32.dll', 'ChooseColorA', CHOOSECOLOR);
//If the user pressed ok convert it to hex
if(result == 1)
{
//Get decimal values
var r = CHOOSECOLOR.ReadDWORD(12) & 0xFF;
var g = (CHOOSECOLOR.ReadDWORD(12) / 0x100) & 0xFF;
var b = (CHOOSECOLOR.ReadDWORD(12) / 0x10000) & 0xFF;
//Get hex values
var hexchars="0123456789ABCDEF";
var r = hexchars.charAt((r >> 4) & 0xf) + hexchars.charAt(r & 0xF);
var g = hexchars.charAt((g >> 4) & 0xf) + hexchars.charAt(g & 0xF);
var b = hexchars.charAt((b >> 4) & 0xf) + hexchars.charAt(b & 0xF);
Wnd.SetControlText("NameEdit", firstHalf + "·$#" + r + g + b + secondHalf);
numCharsAdded = 9;
} else {
Wnd.SetControlText("NameEdit", firstHalf + "·$" + secondHalf);
numCharsAdded = 2;
}
}
if(ControlId == "BtnBlack")
{
Wnd.SetControlText("NameEdit", firstHalf + "·$1" + secondHalf);
numCharsAdded = 3;
}
// Insert special characters when their buttons are pressed
if(ControlId == "BtnA")
Wnd.SetControlText("NameEdit", firstHalf + "α" + secondHalf);
if(ControlId == "BtnE")
Wnd.SetControlText("NameEdit", firstHalf + "ε" + secondHalf);
if(ControlId == "BtnH")
Wnd.SetControlText("NameEdit", firstHalf + "н" + secondHalf);
if(ControlId == "BtnI")
Wnd.SetControlText("NameEdit", firstHalf + "ι" + secondHalf);
if(ControlId == "BtnN")
Wnd.SetControlText("NameEdit", firstHalf + "ŋ" + secondHalf);
if(ControlId == "BtnNN")
Wnd.SetControlText("NameEdit", firstHalf + "и" + secondHalf);
if(ControlId == "BtnNNN")
Wnd.SetControlText("NameEdit", firstHalf + "И" + secondHalf);
if(ControlId == "BtnO")
Wnd.SetControlText("NameEdit", firstHalf + "σ" + secondHalf);
if(ControlId == "BtnP")
Wnd.SetControlText("NameEdit", firstHalf + "ρ" + secondHalf);
if(ControlId == "BtnR")
Wnd.SetControlText("NameEdit", firstHalf + "я" + secondHalf);
if(ControlId == "BtnT")
Wnd.SetControlText("NameEdit", firstHalf + "т" + secondHalf);
if(ControlId == "BtnU")
Wnd.SetControlText("NameEdit", firstHalf + "υ" + secondHalf);
if(ControlId == "BtnW")
Wnd.SetControlText("NameEdit", firstHalf + "ω" + secondHalf);
if(ControlId == "BtnY")
Wnd.SetControlText("NameEdit", firstHalf + "ч" + secondHalf);
if(ControlId == "BtnYY")
Wnd.SetControlText("NameEdit", firstHalf + "Ч" + secondHalf);
if(ControlId == "BtnTm")
Wnd.SetControlText("NameEdit", firstHalf + "™" + secondHalf);
if(ControlId == "BtnCross")
Wnd.SetControlText("NameEdit", firstHalf + "†" + secondHalf);
if(ControlId == "BtnRArrow")
Wnd.SetControlText("NameEdit", firstHalf + "»" + secondHalf);
if(ControlId == "BtnLArrow")
Wnd.SetControlText("NameEdit", firstHalf + "«" + secondHalf);
if(ControlId == "BtnB")
Wnd.SetControlText("NameEdit", firstHalf + "в" + secondHalf);
if(ControlId == "BtnK")
Wnd.SetControlText("NameEdit", firstHalf + "к" + secondHalf);
if(ControlId == "BtnM")
Wnd.SetControlText("NameEdit", firstHalf + "м" + secondHalf);
// Set focus back to the edit box and then move the cursor back to where it was
Interop.Call("user32","SetFocus", Wnd.GetControlHandle("NameEdit"));
Interop.Call("user32","SendMessageW", Wnd.GetControlHandle("NameEdit"), EM_SETSEL, Start.ReadDWORD(0) + numCharsAdded, Start.ReadDWORD(0) + numCharsAdded);
// The save and the close button
if(ControlId == "BtnClose")
Wnd.Visible = false;
if(ControlId == "BtnSet")
{
if(Wnd.Combo_GetCurSel("NamePm") == 0)
Messenger.MyName = Wnd.GetControlText("NameEdit");
else
Messenger.MyPersonalMessage = Wnd.GetControlText("NameEdit");
}
}
function OnWndMainEvent_EditTextChanged(Wnd, ControlId)
{
if(ControlId == "NameEdit")
Wnd.SetControlText("NameEditPreview", Wnd.GetControlText("NameEdit"));
}
ps. I have turned on e-mail notification so I will be able to reply more promptly in the future.
|
|