Shared variables in an activeX exe


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Shared variables in an activeX exe

  1. #1
    Joel Ryan Guest

    Shared variables in an activeX exe

    Hello group
    I just read an article in VBPJ (Oct 99) about messaging. In it,
    they use a public object variable in a standard module to communicate
    between instances of the program. The program is set as an ActiveX
    EXE. It seems that every time I start the EXE, the public object in
    each instance point to the same object. It is declared like this:

    Public gobjMathProblemCenter As New MathProblemCenter

    Why does this occur? If someone showed me this code, I would assume a
    new object is created everytime a new instance of the app is started.

    Thanks a 10^6
    -- Joel


  2. #2
    Joel Ryan Guest

    Re: Shared variables in an activeX exe

    Below is what one person wrote me (thanks BTW). I'll put it on the
    newsgroup for others to read. Any other comments on this?
    -- Joel


    -------- Original Message --------
    Subject: Re: Shared variables in an activeX exe
    Date: Fri, 11 Aug 2000 21:22:28 +1000
    From: "Steve Fillingham" <steve51@ihug.com.au>
    Reply-To: "Steve Fillingham" <steve51@ihug.com.au>
    Organization: CodeDrive Pty Ltd
    To: "Joel Ryan" <jryan@vsi-hq.com>
    References: <3992C588.C97A02F9@vsi-hq.com>

    Hi Joel,
    I think this is because (under 95 & 98) the ActiveX EXE is only loaded

    once and simply referenced by multiple clients. If you are running it as
    a
    DCOM server on NT, since DCOM under NT will create a seperate instance for

    each client depending upon how the client is logging on to the DCOM
    server.
    You can set it up thru DCOMCNFG to log on as a single specified user and
    it
    will reference the same instance of your ActiveX EXE.
    Im not that familiar with what Iv said here, Im just getting into this

    stuff myself. Hope it helps anyway ..

    Steve Fillingham
    steve51@ihug.com.au



    Joel Ryan wrote:

    > Hello group
    > I just read an article in VBPJ (Oct 99) about messaging. In it,
    > they use a public object variable in a standard module to communicate
    > between instances of the program. The program is set as an ActiveX
    > EXE. It seems that every time I start the EXE, the public object in
    > each instance point to the same object. It is declared like this:
    >
    > Public gobjMathProblemCenter As New MathProblemCenter
    >
    > Why does this occur? If someone showed me this code, I would assume a
    > new object is created everytime a new instance of the app is started.
    >
    > Thanks a 10^6
    > -- Joel



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center