Shoutbox

How's this for a strange problem? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: How's this for a strange problem? (/showthread.php?tid=50263)

How's this for a strange problem? by RaceProUK on 09-09-2005 at 01:08 PM

I've added a new configuration setting to Phoenix (so yes there will be at least one new feature soon), but it's triggered some very weird behaviour. It's a simple BOOL, like most other config settings, but it's value determines whether it crashes Messenger or not :S
If it's set to 0, everything's fine. If it's set to 1, Messenger 6.2 just crashes, and Messenger 7.0 crashes with an access violation when you want to sign in with another address.

Weird, no?

Edit: And before you say I've done something stupid, I haven't - I've done what I've done with all other BOOL config settings, and they all work.


RE: How's this for a strange problem? by Mnjul on 09-09-2005 at 01:48 PM

Would you tell us what else codes are using the BOOL variable? Also, if you try to declare it as LONG and assign an initial value when you declare it, would that stop Messenger from crashing?


RE: How's this for a strange problem? by RaceProUK on 09-09-2005 at 04:01 PM

Apart from a few if (boolVar), I use it in only SendMessage(), RegSetValueEx() and RegQueryValueEx() (typecasted to the correct type of course).
The data is saved in the Registry as REG_BINARY, and is only one byte big. I'm kinda exploiting little-endian here, though that shouldn't matter, since it's a BOOL.

I don't get where it's going wrong, as I have 13 of these BOOLs, and the latest (the 13th) is the only one that causes the problems. All the other 12 work fine, and have always done so.


RE: How's this for a strange problem? by Mnjul on 09-10-2005 at 03:35 AM

Hmm... what I see could be wrong is SendMessage... I know perhaps you use SendMessage for other bool variables and it does work for them, but...would you give us the codes for the crashing one? :)


RE: How's this for a strange problem? by RaceProUK on 09-10-2005 at 09:18 PM

I actually found the problem, and it's got nothing to do with what I do with the variable. It's actually what I was doing as a result of an if test on the variable i.e. the piece of code i was working on was causing the problem. I've now fixed it so it won't happen again :D

To explain more, I'd set a WInEvent hook to catch changes to the History part of a convo window. Thing is, it was also catching the 'Sign in as someone else' dialog, which obviously has a totally different structure. Add an oversight in error-checking, and presto! crashes galore.