![]() |
| | #1 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,768
| Dynamic Toolbars I'm using VC6 SP5 with MFC to create my application. I have a Framewindow and a Toolbar. I can dynamically set the toolbars buttons. BUT: Obviously Framewindow/Toolbar pairs have some kind of automation that when the parent window has no command handler ( ON_COMMAND() ) of the toolbar buttons command ID, the toolbar button is disabled. What a funny idea. I can dynamically create buttons, but not their command handlers, as I need a unique function for each... who was the genius that thought this plan up ? If you have any clue what I'm talking about and/or any helpful hints, demo sources, tutorials, please share. Because dynamic buttons are no fun if I don't have a chance to enable them. I surfed the .net, but nothing really dynamic came up. I need it to be really dynamic, not cheats like create a hundred and hope that's the limit. I need it to be customizable in the code, not by the user of my app. I know I can create the button. I can set the command handler ID. But If I have no hard-coded command handler, the framework will disable the button. Tearing my hair out already... ![]() [Edit: If you know how to do it in API only, your welcome... I will write the Toolbar class myself if I have to, I just need those *#&% dynamic stuff... ]
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
| | #2 |
| the hat of redundancy hat Join Date: Aug 2001 Location: Hannover, Germany
Posts: 2,768
| Just to keep you in the loop: I dug up countless tutorials from the net. Not one did what I needed. Probably it's mentioned nowhere how to do it. So I scanned the MFC sourcecode for a solution and after 2 hours of searching, I turned up this: PHP Code: I'm still quite annoyed, this is something not that uncommon... and it's not even documented, because OnUpdateCmdUI is a method of CControlBar, CToolbars baseclass... *grrrrr* Case closed.
__________________ hth -nv She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate." When in doubt, read the FAQ. Then ask a smart question. |
| nvoigt is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamic array of structures containing yet another dynamic array of structures | innqubus | C Programming | 2 | 07-11-2008 07:39 AM |
| How do I clean up a dynamic array of pointers to objects? | rakan | C++ Programming | 4 | 11-02-2006 11:41 AM |
| Identify dynamic IP address of network device | BobS0327 | Tech Board | 2 | 02-21-2006 01:49 PM |
| operator overloading and dynamic memory program | jlmac2001 | C++ Programming | 3 | 04-06-2003 11:51 PM |
| Dynamic memory confusion | ripper079 | C++ Programming | 5 | 11-04-2002 06:15 PM |