What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [SOLVED] ChooseFontW causes Messenger crash after closing window

[SOLVED] ChooseFontW causes Messenger crash after closing window
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. [SOLVED] ChooseFontW causes Messenger crash after closing window
Hello again!

It seems like I've stumbled on some kind of scripting problem once again. This time, it's much more problematic than [?] Weirdness. Evolved. or [?] Trying to get into the advanced stuff...

Here's what's happening:
  1. The user opens the script's window.
  2. The user clicks a button.
  3. The script calls ChooseFontW to open a font dialog.
    • If the result of this call is zero (meaning that the user clicked Cancel in the dialog), the script stops here.
    • If the result of this call is nonzero (meaning that the user clicked OK), the script continues.
  4. The script reads the selected font name from the result structure and sets the button text to this name.
  5. The user closes the script window.
  6. Messenger crashes.
There really is nothing I can do to prevent this crash. The structures are cleared, nothing else is done, it doesn't crash when the user clicks Cancel or doesn't click the "Choose a font" button at all... and I have no clue why or how this is happening.

Attached is a sample script which proves this behavior. Feel free to mess around with it, do whatever you want to test this.

Please, help me if you can! :)

System information:
Windows Vista Ultimate x64 (6.0.6000)
Windows Live Messenger 8.5.1018
Messenger Plus! Live 4.50.0.317 (private BETA received from Patchou to test new scripting methods)

.plsc File Attachment: Choose Font Test.plsc (2.68 KB)
This file has been downloaded 171 time(s).

This post was edited on 03-09-2008 at 05:40 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
03-09-2008 12:03 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] ChooseFontW causes Messenger crash after closing window
1704 08/03/09 10:09:49| CChooseFont - created
1704 08/03/09 10:09:53| ERROR: CRT - HEAP CORRUPTION DETECTED: after Normal block (#43859) at 0x022D8AE0.
                        CRT detected that the application wrote to memory after end of heap buffer.
1704 08/03/09 10:09:53| CDebug::GenerateDumpFile has been called. Exception: 0xc0000005
1704 08/03/09 10:09:53| Minidump is being created...
1704 08/03/09 10:09:54| Minidump creation complete (0309_100953)
1704 08/03/09 10:09:54| CDebug::GenerateDumpFile has been called. Exception: 0xc0000005
1704 08/03/09 10:09:54| Minidump is being created...
1704 08/03/09 10:09:55| Minidump creation complete (0309_100954)


Appears to be the wrong structure size, I tried LF of 92 and it still did it so...
03-09-2008 02:11 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [?] ChooseFontW causes Messenger crash after closing window
It doesnt crash here. It works nicely.

0510 08/03/09 16:24:09| A custom script window is being created
0510 08/03/09 16:24:09| CInterfaceWindow - Window creation: WndTest
0510 08/03/09 16:24:09| CScriptObjectCustomWnd created. This: 02213e30
0510 08/03/09 16:24:11| CChooseFont - created
0510 08/03/09 16:24:28| CInterfaceWindow - Window destruction: WndTest



HOWEVER, as Matty already stated, the LOGFONT structure's length must be 92 !
code:
var LF = Interop.Allocate(92); //must be 92, see MSDN docs!!!!

This post was edited on 03-09-2008 at 03:35 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-09-2008 03:22 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] ChooseFontW causes Messenger crash after closing window
Seems like that size thing fixed it. Thank you! :D
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
03-09-2008 04:17 PM
Profile E-Mail PM Web 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