Passing object to another class in C#
Results 1 to 4 of 4

Thread: Passing object to another class in C#

Threaded View

  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    USA
    Posts
    422

    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
    Cannot take the address of, get the size of, or declare a pointer to a managed type ('cell_server.opt') (CS0208)
    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.
    Code:
                opt *point = &o;
                options OptionsWindow = new options(point);
    I can't really see what I'm doing wrong, so any help would be greatly appreciated.
    Attached Files Attached Files

Similar Threads

  1. cmd.exe boxes flashing around screen on startup
    By sphanlon in forum Spyware / Adware
    Replies: 11
    Last Post: April 1st, 2013, 08:05 PM
  2. Windows Error Messages
    By cheyenne1212 in forum Miscellaneous Security Discussions
    Replies: 7
    Last Post: February 1st, 2012, 01:51 PM
  3. Should I be worried....?
    By jerichoholic in forum Spyware / Adware
    Replies: 12
    Last Post: November 30th, 2004, 10:14 AM
  4. HJTlog and the ISP ads
    By coolcamel in forum Spyware / Adware
    Replies: 8
    Last Post: September 29th, 2004, 02:54 PM
  5. Information Leakage from Optical Emanations
    By E5C4P3 in forum Miscellaneous Security Discussions
    Replies: 5
    Last Post: March 7th, 2002, 06:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides