Button_SetCheckState - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: Button_SetCheckState (/showthread.php?tid=97675) Button_SetCheckState by enoid on 05-26-2011 at 11:28 PM
I'm having a problem with the rewriting of my script. I'm trying to implement as much as possible into my DLL and so far everything works without a problem. There's only one thing that doesn't seem to work, period. I'm talking about Button_SetCheckState. xml code:...and how we set it @ enabled in JScript: jscript code: Everythings works. Now try to implement it in C++: c++ code:It does NOT work The strange thing is, SetControlText works (just a simple StaticControl for testing purposes), so one would asume that Button_SetCheckState should work aswell (and yes, I've tried switching them around). I've been trying loads of things, using the VARIANT_BOOLs instead of the normal true/false, trying to use the 'raw' version, trying to get the value with Button_IsChecked too see if it was changed but not visible, checking if the WindowId is correct, and too much other things too write down here... Anyone got an idea what it could be, because it has been driving me insane for the last two days RE: Button_SetCheckState by matty on 05-27-2011 at 01:38 AM Try passing 1 or 0 instead of true/false. RE: RE: Button_SetCheckState by enoid on 05-27-2011 at 07:50 AM
quote:Same thing. To be sure I'm not screwing it up elsewhere in my code, I just took the example code from Mnjul and only added the code it's all about. See the attachment. See 'PlusScriptDLLExample.cpp' for the code and (if needed) change the import to build. RE: Button_SetCheckState by Eljay on 05-27-2011 at 08:06 AM
Changing it to use VARIANT_BOOL seems to work fine for me. c++ code: RE: RE: Button_SetCheckState by enoid on 05-27-2011 at 08:33 AM
quote:Yes it does,.. Thanks! I could have sworn I tried that in my original code too (I even mention it in my opening post...) Now I feel like an idiot RE: Button_SetCheckState by Mnjul on 05-27-2011 at 08:47 AM
Good to know you got it solved 'cos I am pretty sure it should work...at least when I wrote the tutorial it worked. (It was Plus! 4 when I wrote the tutorial, and I didn't check if Plus! 5 broke things...so I was a little bit worried when I saw your post earlier today). RE: RE: Button_SetCheckState by enoid on 05-27-2011 at 11:31 AM
quote:Thanks for clearing that up. I just looked at some of my revisions and I saw that I never tried VARIANT_TRUE itself. I tried to cast a bool or int to a VARIANT_BOOL, assuming it would work. After your explanation now trying it with -1 it magically works. Ahh well, ternary operations to the resque. Also, thanks for your tutorial, it motivated and helped me to get started on the project I'm currently working on and it sure helped me a lot! |