Announcement

Collapse
No announcement yet.

Shared Vars in DLLs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shared Vars in DLLs

    Is there any way , OTHER than FILE MAPPING, to share Variables between seperate instances of the same DLL?

  • #2
    Larry --

    Generally speaking, each program -- each "process", to use the Windows term -- is isolated from every other program. This is part of the design of the operating system.

    There is a group of mechanisms called "InterProcess Communication" that allow processes to communicate with each other. For the most part they are "message" oriented. For example, things like Pipes and MailSlots can be used to establish links between programs. You can think of them as one program opening a file for output, and another program opening it for input, but there really is no "file" and everything is done in memory. They are strictly "input-output" functions, i.e. one program places a string in the Pipe or MailSlot, and the other end can read it. It is not like two programs both having a binary or random-access file open at the same time, or having access to the same variable, at least not directly.

    I would suggest that you visit the MSDN Search Engine...

    http://search.microsoft.com/us/dev/default.asp

    ...and search for "IPC". Here is a quick overview...

    http://support.microsoft.com/support...s/Q95/9/00.ASP

    -- Eric


    [This message has been edited by Eric Pearson (edited June 28, 2000).]
    "Not my circus, not my monkeys."

    Comment


    • #3
      What's wrong with filemapping?

      hellobasic

      Comment


      • #4
        Unless I missed something, if I want to have several variables visible between instances, I whould have to locate all of the vars in a UDT and then copy that structure TO the MappedFile every time I updated one of the vars. To read the vars I would have to copy the MappedFile TO the structure each time I need the vars. So... what did I miss? It can't be that complicated, can it? What I need a PB equivalant of C's - #pargma data_seg "shared" -

        ------------------




        [This message has been edited by Larry Westrick (edited June 28, 2000).]

        Comment

        Working...
        X