Results 1 to 6 of 6

Thread: not Global, Universal variables

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Is there a way to declare variables as Universal so I can access them in any project so I don't have to use files to share them..?

    Thanks in advance!

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    as in have 2 seperate projects and a variable they can both access, no.

    The best way to get 2 standard exes to talk is to use send message.

    you can have something a bit like a shared variable using something called a filemapping, you'd need to set up a property in each of your projects to do it and I'm not sure exactly how to do It. I'll look into it if you want.

  3. #3
    New Member
    Join Date
    May 2000
    Posts
    5
    There is no easy way of sharing variables across projects. The only way I know of is to create a DLL and share it that way.

  4. #4
    Guest

    Talking

    You can even use winsock to trans. values to eacht program
    you have created.. Or you can use files to trans. those
    values. . My men. There are many way's to do it..

    But wiSh one woUld be tHe besT. I dUnO......

    Strange. Aint it..

  5. #5
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Talking Major league nutcase....

    If you are really into this (at least on WinNT!), you can use API to create shared memory (I'm not sure if it works on other platforms). This memory can then be accessed from two (or more) executables. YOu can store what you like in it.

    It has to be used carefully though, with locks so that only one exe can read/write to the shared memory at one time.

    I can provide more info if you want...e-mail me.



    Dan

  6. #6

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Unfortunately I'm coding for Win95/98 too. (The program should run on any win os). Well, thank you all for the answers. Eh Sam, how would you send messages? Or better: How does the other program know if there comes a message from the first program, that it has to take care about? I mean, VB is handling the WMs for us..?


    However, I think files are the easiest way... will take that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width