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. Visual Basic
  4. APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2

APPLICATION 1 TO ACCESS GLOBAL VARIABLE THATS IN APPLICATION 2

Scheduled Pinned Locked Moved Visual Basic
question
4 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.
  • A Offline
    A Offline
    Anoop Brijmohun
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • A Anoop Brijmohun

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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...

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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...

        A Offline
        A Offline
        Anoop Brijmohun
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • A Anoop Brijmohun

          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

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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...

          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