how to get the address of a managed type
-
hi, I'm new to C#,I have this problem and would apriciate if someone would give me an idea . I have a object initilazed in a Windows form and i wold like to use the same oject in some components and the way I was thinking was to get the address of this object. But since it's a managed object the compiler doesn't alow me to take it's address. :confused: Please give me any ideas to overcome this, thanks a lot for your time Endri
-
hi, I'm new to C#,I have this problem and would apriciate if someone would give me an idea . I have a object initilazed in a Windows form and i wold like to use the same oject in some components and the way I was thinking was to get the address of this object. But since it's a managed object the compiler doesn't alow me to take it's address. :confused: Please give me any ideas to overcome this, thanks a lot for your time Endri
Like this:
SomeObject obj = new SomeObject();
Component1.Prop1 = obj;
Component2.Prop2 = obj;All objects are refered to through "object references". You can freely pass this object reference to any part of your system. -- Peter Stephens