Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to get the address of a managed type

how to get the address of a managed type

Scheduled Pinned Locked Moved C#
csharphelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • L Lost User

      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

      P Offline
      P Offline
      Peter Stephens
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups