473,499 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to determine a C# class in C++ code

Hi,
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
  1. void CGraphControlView::ObjectDoubleClicked(System::Object^ sender, Northwoods::Go::GoObjectEventArgs^ e)
  2. {
  3.     TRACE(_T(" Graph object double clicked\n"));
  4. }
  5.  
Now, since I am not so familiar in writing mixed mode applications, my question is:
- 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
  1.     public class GraphNode : Object
  2.  
Expand|Select|Wrap|Line Numbers
  1. void CGraphControlView::ObjectDoubleClicked(System::Object^ sender, Northwoods::Go::GoObjectEventArgs^ e)
  2. {
  3.     TRACE(_T(" Graph object double clicked\n"));
  4.     // I would like to add something like
  5.     if (e->Object is a type of GraphNode)
  6.         DoSomething ....
  7.     else if (e->Object is a type of SomeOtherObject)
  8.         DoSomethingElse ....
  9. }
  10.  
Help would be appreciated?
/Juri
Nov 20 '10 #1
0 944

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1246
by: John E Katich | last post by:
When attempt to use the Event Wizard I get the following error message: "Add/Remove of the function impossible, because the parent class code is read only" The Project was convert from VC 6.0....
9
2941
by: JohnSmith | last post by:
I suspect this is easy, but I have been stumped for a day trying to solve this.. I want to be able to have an unlimited number of aspx pages that all use the code in one class file. I want code...
1
1006
by: TJS | last post by:
I have a class and method (class b method b) that I want to share with all other classes, so I don't have to keep putting th same code in every class. How is this done?
4
1602
by: Dave | last post by:
Greetings, I have a web application that will be hosted on our intranet. I would like to determine, via code the user's windows login name and domain in the following format: DOMAIN\loginname...
5
1934
by: Noozer | last post by:
I have two Classes in use in an ASP application... The first Class is named "ORDER". It represents one job order. It has a Delete method, among others, which deletes it from my database. The...
5
2044
by: jandhondt | last post by:
In VS2005 with VB.NET when a form or usercontrol is inherited: it is terribly annoying that the code view shows as Public Class statement without the inherits statement. You have to go to the...
15
2524
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
5
2420
by: sherifffruitfly | last post by:
Hi, I want to use a c++ class in my c# application. Are there any clear step-by-step tutorials on an easy way to achieve this? All I've been able to find are relatively complicated discussions...
2
1431
by: harimca14 | last post by:
Question 1: a. Define a data structure to describe a sphere. b. Write a set of three optimized C/C++ functions. c. The first function, given a sphere and a point, will call a second function to...
1
1006
by: =?Utf-8?B?S2Vycnk=?= | last post by:
Hi, i'm having a strange issue, I've created a Class dervived from a DataGridView that has all my columns, events properties etc defined. I take this class and instanciate it on a Form. The...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.