Is it possible to share objects (Managed code c#) across applications?
-
Thanks, Diana.
-
Thanks, Diana.
yes. make the object public and add a refernece. :)
-
yes. make the object public and add a refernece. :)
Nonsense! You cannot make an "object" public, you can make a "class" public. What she is looking for is called "IPC" - Inter Process Communication. Take a Google search for it [^].
-- Try our Windows-based CMS: www.zeta-producer.com Try our ticket helpdesk system: www.zeta-helpdesk.com See me working: www.magerquark.com
-
Thanks, Diana.
You need to provide more info. Do you want to pass an instance of an object between apps, or do you want to create a class, and use instances of that class in different apps ? Or something else ?
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Thanks, Diana.
Are your applications all on the same machine? You might want to try Enterprise Services. .Net remoting also works well and you can setup singleton objects which would be shared by all connecting clients. Services are useful if you want highly persistent objects. maybe combined with one of the methods above. Persisting the objects to an XML file or database might work if your design is very simple. As always the solution depends on what you are trying to achieve. HTH Russ
-
You need to provide more info. Do you want to pass an instance of an object between apps, or do you want to create a class, and use instances of that class in different apps ? Or something else ?
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
Hi Christians, There is one application which is developed totally on c#. At runtime I want to make use of one of the objects of these application from another application that too is developed in c#. But in the first application I cannot make any modification or the channel informations are not available otherwise I could have used remoting. There is a method "GetActiveObject" but it is working only for unmanaged objects (I think). Is there any method equivalet to this which can give the referece of the active or running objects? Thanks Diana.
-
Are your applications all on the same machine? You might want to try Enterprise Services. .Net remoting also works well and you can setup singleton objects which would be shared by all connecting clients. Services are useful if you want highly persistent objects. maybe combined with one of the methods above. Persisting the objects to an XML file or database might work if your design is very simple. As always the solution depends on what you are trying to achieve. HTH Russ
Hi Russ, Bothe applications are running on the same machine. As I don't know the channel informations, I cannot use remoting as well as I cannot modify the application. I would like to know is there any method similar to "GetActiveObject" available for this? Thanks Diana.
-
Hi Christians, There is one application which is developed totally on c#. At runtime I want to make use of one of the objects of these application from another application that too is developed in c#. But in the first application I cannot make any modification or the channel informations are not available otherwise I could have used remoting. There is a method "GetActiveObject" but it is working only for unmanaged objects (I think). Is there any method equivalet to this which can give the referece of the active or running objects? Thanks Diana.
OK, you want to access an object, an instance of a class, inside another app ? You really cannot. If you can't change the program, there is absolutely no way you can pull an object out of it. The other program needs to anticipate and respond to your attempts to communicate.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
OK, you want to access an object, an instance of a class, inside another app ? You really cannot. If you can't change the program, there is absolutely no way you can pull an object out of it. The other program needs to anticipate and respond to your attempts to communicate.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
Ok, Thanks. But how is it possible with "GetActiveObject" method for unmanaged objects? Diana.
-
Ok, Thanks. But how is it possible with "GetActiveObject" method for unmanaged objects? Diana.
I've never used them, but it looks to me like they work with COM objects. A COM object has a defined public interface, the author has already defined a method to interact with an external program.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
OK, you want to access an object, an instance of a class, inside another app ? You really cannot. If you can't change the program, there is absolutely no way you can pull an object out of it. The other program needs to anticipate and respond to your attempts to communicate.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
FYI... It is possible to attach a dll into a process from a different process and invoke a static method available with that dll. So it is possible to enter into a process and do whatever there, though we can't access the data back to the attaching process. If interested to know more see the article ".NET Object Spy and InvokeRemote". Thanks Diana.