Sharing single instance of Activex DLL


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Sharing single instance of Activex DLL

  1. #1
    Ed Guest

    Sharing single instance of Activex DLL


    I have an application (NotesManager) that runs in the background and another
    app (TimeTracker) that doesn't but they both have to get information (login,
    username, permissions) from a Login ActiveX DLL I made. Is there away to
    share the DLL info, so that if NotesManager is already logged in TimeTracker
    can get the username and permissions from NotesManger through the DLL? So
    if a user starts NotesManager and it uses the DLL and the instance of the
    DLL was the properties like username="Les Claypool" and Permissions="Admin"
    then when he starts TimeTracker it just checks if he is already logged in
    and uses the same info already in DLL instance in NotesManager (so it doesn't
    have to log in again)?

    I though about just writing the current user info to the registry temporarily
    but it would have to pass the username and password and I'd rather not have
    that visible anywhere even encrypted.

  2. #2
    L.J. Johnson Guest

    Re: Sharing single instance of Activex DLL

    Ed,

    Couple of thoughts:

    (1) Make both apps ActiveX exe -- whoever started second could query whoever
    started first
    (2) Use sockets -- same idea as above -- when app starts, queries a custom
    socket to see if the other app is running
    (3) Use a memory-mapped file, mapped to the pagefile, not a physical disk
    file. I'd still encrypt it, but should be fairly safe.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>

    "Ed" <edneeis@msn.com> wrote in message news:3af818a4$1@news.devx.com...
    >
    > I have an application (NotesManager) that runs in the background and

    another
    > app (TimeTracker) that doesn't but they both have to get information

    (login,
    > username, permissions) from a Login ActiveX DLL I made. Is there away to
    > share the DLL info, so that if NotesManager is already logged in

    TimeTracker
    > can get the username and permissions from NotesManger through the DLL? So
    > if a user starts NotesManager and it uses the DLL and the instance of the
    > DLL was the properties like username="Les Claypool" and

    Permissions="Admin"
    > then when he starts TimeTracker it just checks if he is already logged in
    > and uses the same info already in DLL instance in NotesManager (so it

    doesn't
    > have to log in again)?
    >
    > I though about just writing the current user info to the registry

    temporarily
    > but it would have to pass the username and password and I'd rather not

    have
    > that visible anywhere even encrypted.




  3. #3
    Ed Guest

    Re: Sharing single instance of Activex DLL


    I thought of the sockets way, but figured I'd check for something better.
    So an ActiveX exe can share its info but a DLL can't is that it? I don't
    quite get option 3??? Thanks for the help.

    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >Ed,
    >
    >Couple of thoughts:
    >
    >(1) Make both apps ActiveX exe -- whoever started second could query whoever
    >started first
    >(2) Use sockets -- same idea as above -- when app starts, queries a custom
    >socket to see if the other app is running
    >(3) Use a memory-mapped file, mapped to the pagefile, not a physical disk
    >file. I'd still encrypt it, but should be fairly safe.
    >
    >--
    >L.J. Johnson, Slightly Tilted Software
    >Microsoft MVP (Visual Basic)
    >LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    ><http://www.SlightlyTiltedSoftware.com>
    >Ask The NT Pro at <http://www.devx.com/gethelp>
    >
    >"Ed" <edneeis@msn.com> wrote in message news:3af818a4$1@news.devx.com...
    >>
    >> I have an application (NotesManager) that runs in the background and

    >another
    >> app (TimeTracker) that doesn't but they both have to get information

    >(login,
    >> username, permissions) from a Login ActiveX DLL I made. Is there away

    to
    >> share the DLL info, so that if NotesManager is already logged in

    >TimeTracker
    >> can get the username and permissions from NotesManger through the DLL?

    So
    >> if a user starts NotesManager and it uses the DLL and the instance of

    the
    >> DLL was the properties like username="Les Claypool" and

    >Permissions="Admin"
    >> then when he starts TimeTracker it just checks if he is already logged

    in
    >> and uses the same info already in DLL instance in NotesManager (so it

    >doesn't
    >> have to log in again)?
    >>
    >> I though about just writing the current user info to the registry

    >temporarily
    >> but it would have to pass the username and password and I'd rather not

    >have
    >> that visible anywhere even encrypted.

    >
    >



  4. #4
    Willy Van den Driessche Guest

    Re: Sharing single instance of Activex DLL


    I think the DLL thing is logical. It runs in-process and each EXE gets its
    own copy of all global variables.
    I'm not quite sure about the activeX EXE option either because I think threading
    issues could make the activeX EXE global variables per-thread, which is not
    quite what you want either.
    As far as I know, Currlands book suggests putting the object in the ROT (Running
    object table). We are currently trying this approach and I will post the
    results here later if you're interested.

    "Ed" <edneeis@msn.com> wrote:
    >
    >I thought of the sockets way, but figured I'd check for something better.
    > So an ActiveX exe can share its info but a DLL can't is that it? I don't
    >quite get option 3??? Thanks for the help.
    >
    >"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >>Ed,
    >>
    >>Couple of thoughts:
    >>
    >>(1) Make both apps ActiveX exe -- whoever started second could query whoever
    >>started first
    >>(2) Use sockets -- same idea as above -- when app starts, queries a custom
    >>socket to see if the other app is running
    >>(3) Use a memory-mapped file, mapped to the pagefile, not a physical disk
    >>file. I'd still encrypt it, but should be fairly safe.
    >>
    >>--
    >>L.J. Johnson, Slightly Tilted Software
    >>Microsoft MVP (Visual Basic)
    >>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    >><http://www.SlightlyTiltedSoftware.com>
    >>Ask The NT Pro at <http://www.devx.com/gethelp>
    >>
    >>"Ed" <edneeis@msn.com> wrote in message news:3af818a4$1@news.devx.com...
    >>>
    >>> I have an application (NotesManager) that runs in the background and

    >>another
    >>> app (TimeTracker) that doesn't but they both have to get information

    >>(login,
    >>> username, permissions) from a Login ActiveX DLL I made. Is there away

    >to
    >>> share the DLL info, so that if NotesManager is already logged in

    >>TimeTracker
    >>> can get the username and permissions from NotesManger through the DLL?

    > So
    >>> if a user starts NotesManager and it uses the DLL and the instance of

    >the
    >>> DLL was the properties like username="Les Claypool" and

    >>Permissions="Admin"
    >>> then when he starts TimeTracker it just checks if he is already logged

    >in
    >>> and uses the same info already in DLL instance in NotesManager (so it

    >>doesn't
    >>> have to log in again)?
    >>>
    >>> I though about just writing the current user info to the registry

    >>temporarily
    >>> but it would have to pass the username and password and I'd rather not

    >>have
    >>> that visible anywhere even encrypted.

    >>
    >>

    >



  5. #5
    Paul Clement Guest

    Re: Sharing single instance of Activex DLL

    On 9 May 2001 03:48:59 -0700, "Willy Van den Driessche" <Willy.van.den.driessche@skynet.be> wrote:


    I think the DLL thing is logical. It runs in-process and each EXE gets its
    own copy of all global variables.

    I'm not quite sure about the activeX EXE option either because I think threading
    issues could make the activeX EXE global variables per-thread, which is not
    quite what you want either.
    As far as I know, Currlands book suggests putting the object in the ROT (Running
    object table). We are currently trying this approach and I will post the
    results here later if you're interested.


    With respect to the ActiveX DLL, a distinct instance is mapped into each process so there is no
    feasible possibility of sharing data here. The ActiveX EXE offers a better solution because a single
    (shared) instance can run out-of-process. The only issue is the one of the intrinsic single
    threading you mentioned in the case where method calls from other process can be blocked.

    There are ways to work around the ActiveX EXE issues however.


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  6. #6
    Paul Clement Guest

    Re: Sharing single instance of Activex DLL

    On 9 May 2001 03:48:59 -0700, "Willy Van den Driessche" <Willy.van.den.driessche@skynet.be> wrote:


    I think the DLL thing is logical. It runs in-process and each EXE gets its
    own copy of all global variables.
    I'm not quite sure about the activeX EXE option either because I think threading
    issues could make the activeX EXE global variables per-thread, which is not
    quite what you want either.
    As far as I know, Currlands book suggests putting the object in the ROT (Running
    object table). We are currently trying this approach and I will post the
    results here later if you're interested.

    "Ed" <edneeis@msn.com> wrote:

    The Curland methods were those I was referring to. I have his book (even though I haven't read it)
    and my understanding is that there are multi-threading mechanisms that he has implemented.

    I think it also depends on what you are doing exactly. You can also create asynchronous notification
    events - this is covered in the Visual Basic documentation. The CoffeeMonitor component is an
    example where an ActiveX EXE can be shared.

    Hope this helps.

    Paul
    ~~~~
    pclement@ameritech.net



    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  7. #7
    Ed Guest

    Re: Sharing single instance of Activex DLL


    Thanks I am reading the CoffeMonitor example and it looks like this is what
    I want. Thanks again.

    Paul Clement <UseAdddressAtEndofMessage@swspectrum.com> wrote:
    >On 9 May 2001 03:48:59 -0700, "Willy Van den Driessche" <Willy.van.den.driessche@skynet.be>
    >wrote:
    >
    >
    > I think the DLL thing is logical. It runs in-process and each EXE gets

    its
    > own copy of all global variables.
    > I'm not quite sure about the activeX EXE option either because I think

    threading
    > issues could make the activeX EXE global variables per-thread, which is

    not
    > quite what you want either.
    > As far as I know, Currlands book suggests putting the object in the ROT

    (Running
    > object table). We are currently trying this approach and I will post

    the
    > results here later if you're interested.
    >
    > "Ed" <edneeis@msn.com> wrote:
    >
    >The Curland methods were those I was referring to. I have his book (even

    though I haven't
    >read it)
    >and my understanding is that there are multi-threading mechanisms that he

    has implemented.
    >
    >I think it also depends on what you are doing exactly. You can also create

    asynchronous
    >notification
    >events - this is covered in the Visual Basic documentation. The CoffeeMonitor

    component
    >is an
    >example where an ActiveX EXE can be shared.
    >
    >Hope this helps.
    >
    >Paul
    >~~~~
    >pclement@ameritech.net
    >
    >
    >
    >Paul ~~~ pclement@ameritech.net
    >Microsoft MVP (Visual Basic)



  8. #8
    L.J. Johnson Guest

    Re: Sharing single instance of Activex DLL

    Ed,

    > So an ActiveX exe can share its info but a DLL can't is that it?


    Looks like that's been covered. My ISP access was down for over 30 hours, so
    haven't been able to get on. Sorry...

    > >(3) Use a memory-mapped file, mapped to the pagefile, not a physical disk
    > >file. I'd still encrypt it, but should be fairly safe.


    > I don't quite get option 3???


    Did you lookup the MSDN docs on memory-mapped files? I have at least one
    example on my web site, and Karl has a couple on his (both based on articles
    in VBPJ, if you have those). By mapping to the pagefile, there is not a
    physical, separate disk file available. It *is* in the pagefile itself,
    which is a physical file, but fairly hard to get to directly. But since it
    *does* physically exist, I still suggest encrypting it. Memory-mapped files
    are, as the name suggests, direct mapping of a "file" (in this instance, a
    section of the pagefile) to memory addresses, where you can get to it
    directly.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>




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