Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an ArcEngine application can I control what is passed to the OnCreate() method when a command or tool is initialized?

(I am using a synchronization object because I have both a map and a pagelayout in my form. Rather than just passing the active control I would prefer to just pass the synchronizer because it contains all the controls.)

share|improve this question

closed as unclear what you're asking by PolyGeo, Fezter, iant Sep 10 '13 at 5:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

If anyone is interested! tools = new ToolbarMenuClass(); tools.CommandPool = toolsView.CommandPool; tools.SetHook( <Your[ComVisible( true )]Object> ); – Chaz Sep 30 '11 at 14:22
If anyone is interested! If toolsView is your AxToolbarControl, this sets the Hook: tools = new ToolbarMenuClass(); tools.CommandPool = toolsView.CommandPool; tools.SetHook( <Your[ComVisible( true )]Object> ); However! (This does NOT work! OnCreate() never gets called. Is it necessary to implement a specific interface in your passed object? Don't know... ) – Chaz Sep 30 '11 at 14:39
IHookHelper.Hook says: a menu hook must support IToolbarControl or IToolbarBuddy No dice, however, as even after implementing IToolbarBuddy the OnCreate never gets called. – Chaz Sep 30 '11 at 15:04
Rather than add new information as comments, can you revise your Question so that only it needs to be read by potential answerers, please? Before anyone provides an Answer is the best time to do this. – PolyGeo Sep 9 '13 at 23:07