DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

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

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
ATL/WTL Ribbon Can't get CheckBox state
« on: November 10, 2013, 01:38 AM »
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,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: ATL/WTL Ribbon Can't get CheckBox state
« Reply #1 on: November 11, 2013, 01:01 PM »
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.

Original address: https://www.donationcoder.com/forum/index.php?topic=36505.0