APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2
-
Hi Guys, im not sure if this is possible, Say for eg. I have an application running which has a global variable "User" Declared. i want to retrieve the value stored in "User" from another application. how can this be done? if so, can you direct me to the link? much appreciated, thanks Anoop
-
Hi Guys, im not sure if this is possible, Say for eg. I have an application running which has a global variable "User" Declared. i want to retrieve the value stored in "User" from another application. how can this be done? if so, can you direct me to the link? much appreciated, thanks Anoop
Anoop Brijmohun wrote:
I have an application running which has a global variable "User" Declared. i want to retrieve the value stored in "User" from another application. how can this be done?
You cannot just reference it like any other variable. You actually have to have some kind of communication mechanism in place that both applications support. Though, for the value of a single variable, it sounds like some bad design choices were made designing these apps and setting up communication just to transfer a single value is overkill. Another possibility, though not available until .NET 4.0, would be a memory-mapped file. Both applications basically "share" a common file that exists in memory and can read/write to that file. Though, if sychronization is needed, you'll also need some kind of mechanism in place, depending on your requirements. I would think you need to go back as see if the value can be stored in a well-known place and retrieved by both apps as needed.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Anoop Brijmohun wrote:
I have an application running which has a global variable "User" Declared. i want to retrieve the value stored in "User" from another application. how can this be done?
You cannot just reference it like any other variable. You actually have to have some kind of communication mechanism in place that both applications support. Though, for the value of a single variable, it sounds like some bad design choices were made designing these apps and setting up communication just to transfer a single value is overkill. Another possibility, though not available until .NET 4.0, would be a memory-mapped file. Both applications basically "share" a common file that exists in memory and can read/write to that file. Though, if sychronization is needed, you'll also need some kind of mechanism in place, depending on your requirements. I would think you need to go back as see if the value can be stored in a well-known place and retrieved by both apps as needed.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Hi Thanks For You Response. The App 1 is not my application, its part of an ERP System created by someone else. Within the App1,there are variables that can be called by built in script editors. mmmm... just thought there might be a simple way to access that specific variable. The whole idea behind was that i was building an app [2] to run automated task and instead of the user logging in again, i would be able to get the logged in user from app1 and process. thanks. Anoop
-
Hi Thanks For You Response. The App 1 is not my application, its part of an ERP System created by someone else. Within the App1,there are variables that can be called by built in script editors. mmmm... just thought there might be a simple way to access that specific variable. The whole idea behind was that i was building an app [2] to run automated task and instead of the user logging in again, i would be able to get the logged in user from app1 and process. thanks. Anoop
If you have no control over App1, you've pretty much out of luck. Unless that app exposes some kind of COM interface that you can use to get at the variable.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...