Re: Singleton pattern in VB6?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tony Proctor (tony_proctor_at_aimtechnology_NOSPAM_.com)
Date: 08/15/04


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
>
>



Relevant Pages

  • RE: Users Cant Access Documents on Server
    ... Thanks for using the SBS newsgroup. ... As well as we know, if a workstation would not access network shares, then ... Leave the Default Gateway of the internal NIC blank of the server box. ... Clients That Require SMB Signing ...
    (microsoft.public.windows.server.sbs)
  • Re: Users Cant Access Documents on Server
    ... my computer to the network on the server. ... Connection Wizard none of the computers were listed. ... The Mac clients can not communicate with the server box. ... > Error Messages When You Open or Copy Network Files on Windows XP SP1 ...
    (microsoft.public.windows.server.sbs)
  • Re: [SLE] SMTP authentication
    ... So eventhough my local SMTP server dials up to the internet with a certain username and password, that same username and password would not be used as authentication between my local SMTP server and the ISP's one, should it be used as a relay? ... either defer all outgoing mails until you connect to the internet, then flush out all the mails in the queue. ... Your local server would use an external program like fetchmail to poll the mailserver of your ISP, download the mails and feed them to Postfix. ... The test does NOT say "All clients must be in mynetworks, ...
    (SuSE)
  • RE: VPN Clients Not Registering in AD DNS
    ... via VPN, the DNS records of the VPN clients are unable to be registered. ... Windows 2003 server? ... please let me know whether the clients get the IP ...
    (microsoft.public.windows.server.sbs)
  • Re: Users Cant Access Documents on Server
    ... > then add my computer to the network on the server. ... Did you not see the computers in the Server Management taskpad section? ... The Mac clients can not communicate with the server box. ... >> Error Messages When You Open or Copy Network Files on Windows XP SP1 ...
    (microsoft.public.windows.server.sbs)