Browser Pane Event Handling

Browser Pane Event Handling

Anonymous
Not applicable
506 Views
3 Replies
Message 1 of 4

Browser Pane Event Handling

Anonymous
Not applicable
In VC++ -

I have added a custom browser pane and some nodes. The help file says "The BrowserPanesEvents property of the BrowserPanes collection object returns the BrowserPanesEvents object, supporting browser node event notification".

I get the object:
CComPtr pBrowserPanesEventsObj;
hr = spPanes->get_BrowserPanesEvents (&pBrowserPanesEventsObj);

I can't seem to find anything in help or any of the samples on how to hook this up so node events are handled. I have looked at lots of code in the samples, sometimes I see DispEventAdvise and sometimes AfxConnectionAdvise. If anyone has any guidance on this I would appreciate it.

Thanks
0 Likes
507 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Using the Inventor AddIn wizard for Visual Studio should make this process easy. If you have the wizard installed (if you have not, it is under Inventor 9\SDK\Tools\Wizards), then you can implement event sinks easily. From the wizard's toolbar, which you will get after its installation, will have a button "ATL", select this, then "Inventor" category and "Inventor Event Objects", then press "Next". In the next frame, select the "Inventor Events" tab, choose the "BrowserPanesSink", in the "Names" tab provide a name for your sink, then press "OK". This should implement the event sink, all you have to do is connect the sink and source (using DispEventAdvise, remember to do DispEventUnadvise when it is the right time to disconnect the sink from the source). In your case, since the event is accessible from the document object, you would probably have to implement the ApplicationEventsSink also, and in the ActivateDocument event method, hook up the BrowserPanesEvents sink and in the DeactivateDocument, un-hook. I have posted a template here ( in the autodesk.inventor.customer-files newsgroup): 41997885_3@newsprd01 Thanks, Venkatesh Thiyagarajan, Autodesk Inc. "sandran" wrote in message news:26673678.1100117152375.JavaMail.jive@jiveforum2.autodesk.com... > In VC++ - > > I have added a custom browser pane and some nodes. The help file says "The BrowserPanesEvents property of the BrowserPanes collection object returns the BrowserPanesEvents object, supporting browser node event notification". > > I get the object: > CComPtr pBrowserPanesEventsObj; > hr = spPanes->get_BrowserPanesEvents (&pBrowserPanesEventsObj); > > I can't seem to find anything in help or any of the samples on how to hook this up so node events are handled. I have looked at lots of code in the samples, sometimes I see DispEventAdvise and sometimes AfxConnectionAdvise. If anyone has any guidance on this I would appreciate it. > > Thanks
0 Likes
Message 3 of 4

Anonymous
Not applicable
Venkatesh,

Thank you very much, sorry to take so long to thank you. I
figured out how to do it, but your post confirms that I am
doing it the right way.

Thanks again!
0 Likes
Message 4 of 4

Anonymous
Not applicable
How would I do the same thing in C#?
Thanks
Luc
0 Likes