I have a .NET control hosted in a CWinFormsView. In the CWinFormsView I have enabled events in the .NET control to callback to a method in the CWinFormsView by using the BEGIN_DELEGATE_MAP macro. Everything works just fine, the native method is called properly:
Expand|Select|Wrap|Line Numbers
- void CGraphControlView::ObjectDoubleClicked(System::Object^ sender, Northwoods::Go::GoObjectEventArgs^ e)
- {
- TRACE(_T(" Graph object double clicked\n"));
- }
- How to determine if the class of the Object returned by the EventArgs handler is of a specific class inherited from System::Object, e.g.
Expand|Select|Wrap|Line Numbers
- public class GraphNode : Object
Expand|Select|Wrap|Line Numbers
- void CGraphControlView::ObjectDoubleClicked(System::Object^ sender, Northwoods::Go::GoObjectEventArgs^ e)
- {
- TRACE(_T(" Graph object double clicked\n"));
- // I would like to add something like
- if (e->Object is a type of GraphNode)
- DoSomething ....
- else if (e->Object is a type of SomeOtherObject)
- DoSomethingElse ....
- }
/Juri