Board index » cppbuilder » Fire DCom-events to the specified clients

Fire DCom-events to the specified clients

With the ActiveX automatisation expert of Builder4 I set up a DCom multi
appartment server with event support. Now I have a problem: if a second
client connect`s, I dont know how to fire server events to the right
client.
I failed to set up a single appartment server with event support. Their
are Unlock and Lock Methods needed to fire an event, but not implemented
in the Single appartment server.
I see two ways to solve my problem:
1. reducing the multiappartment server to a single appartment server
2. Sending events to the right client

Any ideas???
--

Dr. Stefan Niehren

 

Re:Fire DCom-events to the specified clients


The way events are fired, they are sent to all connected clients.

.a

Quote
Stefan Niehren wrote:

[snip]

Re:Fire DCom-events to the specified clients


Sorry, but this is not what I observe. If a second client is connecting
to my server I never recieved events.
The other question is, way I cant use a single appartment server to
fire events? I want to compile such a server (created with the C++
Builder4 expert: Application server) I got an error that Lock and Unlock
methods are not declared?

--

Dr. Stefan Niehren

SL Microtest GmbH
Wildenbruchstr. 15
07745 Jena

Tel.  (49) 3641 675 143
Fax  (49) 3641 675 149

http://www.sl-microtest.de

Re:Fire DCom-events to the specified clients


Stefan,

You are correct,  I don't remember if the last client connecting gets the
events, or the first, or none after the second client connects.  I had to
create a static TList of implementation objects in my implementation class.
I then called the Fire_XXXEvent on each of those objects.

in my class header:
  static TList *InterfaceList;

in my constructor...

   if (!InterfaceList)
   {
       InterfaceList = new TList;
   }
   if (InterfaceList)
   {
       InterfaceList->Add(this);
   }

When I want to fire events to my clients...

       if (InterfaceList)
       {
           for (int i = 0; i < InterfaceList->Count; i++)
           {
               TAFInterfaceImpl* oleIf =
                   (TAFInterfaceImpl*)InterfaceList->Items[i];
               if (oleIf)
               {
                   oleIf->Fire_ActiveFormChanged(WideString(Alias),0);
               }
           }
       }

Hope this helps.

Quote
"Stefan Niehren" <nieh...@sl-microtest.de> wrote in message

news:39E6A9D4.90069750@sl-microtest.de...
Quote
> Sorry, but this is not what I observe. If a second client is connecting
> to my server I never recieved events.
> The other question is, way I cant use a single appartment server to
> fire events? I want to compile such a server (created with the C++
> Builder4 expert: Application server) I got an error that Lock and Unlock
> methods are not declared?

> --

> Dr. Stefan Niehren

> SL Microtest GmbH
> Wildenbruchstr. 15
> 07745 Jena

> Tel.  (49) 3641 675 143
> Fax  (49) 3641 675 149

> http://www.sl-microtest.de

Re:Fire DCom-events to the specified clients


Thank's Steve, thats working!

--

Dr. Stefan Niehren

SL Microtest GmbH
Wildenbruchstr. 15
07745 Jena

Tel.  (49) 3641 675 143
Fax  (49) 3641 675 149

http://www.sl-microtest.de

Other Threads