Home > Archive > Visual Basic > April 2006 > Variable Address
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Frank Walsh 2006-04-26, 7:56 am |
| Hi folks..
I need to be able to setup a variable at a specific address in memory that I
can access in VB to allow the passing of a character between another
application and my own..
Any ideas..
Frank
| |
| Michael C 2006-04-26, 6:56 pm |
| "Frank Walsh" <FrankWalsh@discussions.microsoft.com> wrote in message
news:2F7D4E2C-AF4F-4D5E-AB7D-1A6F3BA9FDA3@microsoft.com...
> Hi folks..
>
> I need to be able to setup a variable at a specific address in memory that
> I
> can access in VB to allow the passing of a character between another
> application and my own..
>
> Any ideas..
That won't work. You can get the address but applications cannot access each
other memory space. You could send the WM_COPYDATA message between
applications. Checkout www.buygold.net for a tip that I wrote that uses
WM_COPYDATA. It's called ForwardCommandLine and is designed for when a
second instance of your app is run and you only want 1 instance but it could
be used for your task also.
I probably should have mentioned you could also make your app into an
activeX exe and create a public class with a method that the other app
calls. This is probably the easier method depending on what language the
other app is written in.
Michael
| |
|
| Frank
It's very unlikely that an address based communication between applications
will work, the memory map is not as flat as it was in the 8bit days, the
operating system virtualizes a memory area for each application and will do
everything in its power to prevent one application from writing to the
memory allocated to another application.
There are however lots of way to get application to application
conversations going. The most important question is: do you have access to
the source of BOTH applications?
You can set up a DDE, you could use a common INI file, you could use a
registry location, you could use SendMessage to place a message into a
textbox, and so on and so on. Give more details of what you want and what
you have to work with and you may get some more detailed assistance.
Best Regards
Dave O.
"Frank Walsh" <FrankWalsh@discussions.microsoft.com> wrote in message
news:2F7D4E2C-AF4F-4D5E-AB7D-1A6F3BA9FDA3@microsoft.com...
> Hi folks..
>
> I need to be able to setup a variable at a specific address in memory that
> I
> can access in VB to allow the passing of a character between another
> application and my own..
>
> Any ideas..
>
> Frank
| |
| Jim Mack 2006-04-26, 6:56 pm |
| Frank Walsh wrote:
> Hi folks..
>=20
> I need to be able to setup a variable at a specific address in memory
> that I can access in VB to allow the passing of a character between
> another application and my own..
>=20
> Any ideas..
>=20
As long as both applications know what's going on, you could use =
memory-mapping. You can easily set up a named mapping backed by the =
Windows page file. Check www.mvps.org for code by Karl Peterson that =
does this.
This might be overkill for a single variable, but it does work reliably. =
We wrote similar code in ASM for our Stamina library that makes an array =
in one application automatically and 'magically' shared among as many =
apps as you like.
--=20
Jim Mack
MicroDexterity Inc
www.microdexterity.com
|
|
|
|
|