Re: Singleton pattern in VB6?
From: Tony Proctor (tony_proctor_at_aimtechnology_NOSPAM_.com)
Date: 08/15/04
- Next message: Larry Serflaten: "Re: Control Arrays and Usercontrol.Left"
- Previous message: Jeff Johnson [MVP:VB]: "Re: Writing a right-button popup menu"
- In reply to: Schmidt: "Re: Singleton pattern in VB6?"
- Next in thread: Schmidt: "Re: Singleton pattern in VB6?"
- Reply: Schmidt: "Re: Singleton pattern in VB6?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Aug 2004 00:07:44 +0100
Those helper threads *are* destroyed as soon as they've done their job Olaf.
However, there are a lot of clients to this ActiveX Server. The extra
threads are messy because the Sub Main() is fired for the creation of each
of their apartments, and these have to be distinguished from the creation of
the main STAs for the thread pool.
The client-side users are browser based, but the middle tier is a VB6
component hosted within IIS. Hence, multiple security contexts will be in
use. This remote ActiveX EXE is a specialised data server.
Tony Proctor
"Schmidt" <sss@online.de> wrote in message
news:OEoNALwgEHA.1652@TK2MSFTNGP09.phx.gbl...
>
> "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com> schrieb im
> Newsbeitrag news:%23FWlj5igEHA.2984@tk2msftngp13.phx.gbl...
>
> > ... I therefore have a helper class that ensures
> > the singleton is registered, and returns a reference to me. The reason
I'm
> > still not too happy with that is that my ActiveX EXE has 'thread per
> object'
> > set (because it manages its own thread pool), but then every request to
> > instantiate the helper class creates and runs another thread in my
server,
> > which is just messy.
> But this thread should be destroyed, if the reference to the
> RemoteHelperClass goes out of scope (inside the client).
> The clientside DCOM-Proxy for the RemoteSingleton should communicate with
> the Stub (running inside the Singleton-Context/Thread on the
AX-Server-Side)
> directly, so it shouldn't be necessary to keep the Helper-Class alive.
>
> > I did consider having a separate DCOM Server with different threading
> > configuration, simply to host the helper class. However, apart from the
> > added complexity, I then run into permission problems because the
> > RegisterActiveObject() function cannot specify flags such as
> > ROTFLAGS_ALLOWANYCLIENT (my local application is within IIS). I know
that
> > IRunningObjectTable::Register *can* specify such flags but I've not
found
> a
> > way of calling it from VB.
> Eduardo Morcillos OleLib.Tlb has GetRunningObjectTable and the appropriate
> IRunningObjectTable-Interface "OnBoard", but I would live with the
> HelperClass-Solution.
>
> Just because of interest: Could you describe, what your scenario is?
> Especially "my local application is within IIS" confuses me a bit.
> Are there VBStandardExe-Clients and/or Browserbased-Clients and how are
the
> components on the serverside working together (with IIS?), access
currently
> over LAN or is Internet-Access planned?
>
> Olaf
>
>
- Next message: Larry Serflaten: "Re: Control Arrays and Usercontrol.Left"
- Previous message: Jeff Johnson [MVP:VB]: "Re: Writing a right-button popup menu"
- In reply to: Schmidt: "Re: Singleton pattern in VB6?"
- Next in thread: Schmidt: "Re: Singleton pattern in VB6?"
- Reply: Schmidt: "Re: Singleton pattern in VB6?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|