J
Jim Frazer
Hi,
I'm new to C#, but experienced in C++. I'm converting an ActiveX object to
C#. There is a single instance of a "primary" class which creates two
collections of other "secondary" classes. Each of these other classes needs
to access the information in the primary class - items like a mutex, an
IntPtr to a shared memory map, etc. In C++, I'd probably pass a pointer to
the primary class to each of the secondary classes. What would be the most
efficient method to accomplish this in C#?
Something like:
SecClass mySec = new SecClass(this);
seems like it would be inefficient in use of memory, and the secondary
classes wouldn't see changes in any of the members of the primary class.
TIA,
Jim Frazer
I'm new to C#, but experienced in C++. I'm converting an ActiveX object to
C#. There is a single instance of a "primary" class which creates two
collections of other "secondary" classes. Each of these other classes needs
to access the information in the primary class - items like a mutex, an
IntPtr to a shared memory map, etc. In C++, I'd probably pass a pointer to
the primary class to each of the secondary classes. What would be the most
efficient method to accomplish this in C#?
Something like:
SecClass mySec = new SecClass(this);
seems like it would be inefficient in use of memory, and the secondary
classes wouldn't see changes in any of the members of the primary class.
TIA,
Jim Frazer