December 1st, 2008, 01:57 AM
Passing object to another class in C#
I'm having a problem getting an object I have to pass to another class. I'm trying to have it pass the address to the new class, so I can still use the first instance of the object in the new class. I'm having troubles though, and can't seem to get it to compile. If you want to look, I've uploaded the whole project, I'm working in Sharp Develop.
in case you don't, heres an example of what i'm trying to do.
I have a class called opt in which I've created an object called o.
I have a second class called options that I want to pass the object into when I create an options object. The compiler complains about the managed code
so I used unsafe. This still didn't work, so I tried creating a pointer before I passed it to the class which still didn't work.
Cannot take the address of, get the size of, or declare a pointer to a managed type ('cell_server.opt') (CS0208)
I can't really see what I'm doing wrong, so any help would be greatly appreciated.
opt *point = &o;
options OptionsWindow = new options(point);
By sphanlon in forum Spyware / Adware
Last Post: April 1st, 2013, 08:05 PM
By cheyenne1212 in forum Miscellaneous Security Discussions
Last Post: February 1st, 2012, 01:51 PM
By jerichoholic in forum Spyware / Adware
Last Post: November 30th, 2004, 10:14 AM
By coolcamel in forum Spyware / Adware
Last Post: September 29th, 2004, 02:54 PM
By E5C4P3 in forum Miscellaneous Security Discussions
Last Post: March 7th, 2002, 06:35 AM