topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 7:51 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: ATL/WTL Ribbon Can't get CheckBox state  (Read 10214 times)

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
ATL/WTL Ribbon Can't get CheckBox state
« on: November 09, 2013, 07:38 PM »
Greetings
   I'm trying to get a project off the ground but seem to have run into a wall out of the gate. Using MSVS2008 I created an ATL/WTL project using the Application Wizard add-on that someone here suggested I try experimenting with. In the App Wizard I added a Ribbon control (because I'm an idiot...), to which I add a group, and in that group I added a CheckBox. So far...so good.

   So the fun started when I created a function for the above mentioned Ribbon Control's CheckBox. The function is supposed to test for the state of the CheckBox...and respond accordingly. Simple enough...so I thought. Except no matter what I try I cannot get the control to divulge its own state.

   I have spent the entire day on this, and would dare say I have tried everything except the right answer! I have confirmed that the correct ID for the control in question is indeed being passed to the function ... I just can't seem to do a damn thing with it. The program either crashes, or just ignores me.

   So if anyone familiar with ATL/WTL Ribbon Controls might happen to have a clue what I'm missing they'd be willing to share it would be greatly appreciated. Program is currently being compiled for Unicode...assuming that makes a difference.

Thank you,

Stoic Joker

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: ATL/WTL Ribbon Can't get CheckBox state
« Reply #1 on: November 11, 2013, 07:01 AM »
Hm... So I guess I'll have to answer this one myself.

After some stumbling in the dark with the debugger, it occurred to me - it was bloody obvious with a break point in place actually - that the function was executing before the state I was checking for had been set/changed. So the quandary I guess is/was a side effect of my not working with classes much. *Shrug*

I got out of it by declaring and toggling a module level global, but I'd always understood that as being bad form unless absolutely necessary... :-\ Which apparently for this, it is.