Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.