Board index » delphi » DCOM events

DCOM events

Hi,

        I have a Client connecting to a remote server - both written in Delphi.

        If I manually start the Server first on the remote machine, the client
happily connects,
calling methods on the remote object and sinking events from it.

        If I allow COM to start the server on the remote machine, the events
don't make
it back to the client.

        The server create/connect code in the client is:

          CardServer:=CoCard.Create;

          {Connect card server event to sink}
          FCardEventSink := TCardEventSink.Create(Self);
          InterfaceConnect(CardServer, _ICardEvents, FCardEventSink,
FCardConnection);

        The event code in the server is:

                procedure Tcardserv.OnConfigStatus(eStatus: E_ANA_CONFIG_STATUS);
                  var
                    EC: IEnumConnections;
                    ConnectData: TConnectData;
                    Fetched: Cardinal;
                  begin

                    EC := GetConnectionEnumerator;
                    if EC <> nil then
                    begin

                      {The following line fails in DCOM, is this server was n't
alreasdy running
                       before client is launched}

                      while EC.Next(1, ConnectData, @Fetched) = S_OK do
                        begin
                          if ConnectData.pUnk <> nil then
                            begin
                              beep;
                              (ConnectData.pUnk as
_ICardEvents).OnInitializeStatus(Toleenum(eStatus));
                            end;
                        end;
                    end;

                  end;{procedure TfrmPaPlus.OnConfigStatus}

        Thanks for any help.

Chris Carr.

 

Re:DCOM events


Try configuring the server with an Indentity of "This User" and type in a
valid domain account. Lowering the Authentication level to None might also
work.

have fun
--
Binh Ly
Need help on COM development?
http://www.techvanguards.com

Quote
Chris Carr <cc...@havant.xyratex.com> wrote in message

news:388C82CE.4F7E2266@havant.xyratex.com...
Quote
> Hi,

> I have a Client connecting to a remote server - both written in Delphi.

> If I manually start the Server first on the remote machine, the client
> happily connects,
> calling methods on the remote object and sinking events from it.

> If I allow COM to start the server on the remote machine, the events
> don't make
> it back to the client.

> The server create/connect code in the client is:

>           CardServer:=CoCard.Create;

>       {Connect card server event to sink}
>       FCardEventSink := TCardEventSink.Create(Self);
>       InterfaceConnect(CardServer, _ICardEvents, FCardEventSink,
> FCardConnection);

> The event code in the server is:

> procedure Tcardserv.OnConfigStatus(eStatus: E_ANA_CONFIG_STATUS);
>   var
>     EC: IEnumConnections;
>     ConnectData: TConnectData;
>     Fetched: Cardinal;
>   begin

>     EC := GetConnectionEnumerator;
>     if EC <> nil then
>     begin

>       {The following line fails in DCOM, is this server was n't
> alreasdy running
>        before client is launched}

>       while EC.Next(1, ConnectData, @Fetched) = S_OK do
>         begin
>           if ConnectData.pUnk <> nil then
>             begin
>               beep;
>               (ConnectData.pUnk as
> _ICardEvents).OnInitializeStatus(Toleenum(eStatus));
>             end;
>         end;
>     end;

>   end;{procedure TfrmPaPlus.OnConfigStatus}

> Thanks for any help.

> Chris Carr.

Re:DCOM events


        Thanks - that fixed the problem.

Chris

Quote
Binh Ly wrote:

> Try configuring the server with an Indentity of "This User" and type in a
> valid domain account. Lowering the Authentication level to None might also
> work.

> have fun
> --
> Binh Ly
> Need help on COM development?
> http://www.techvanguards.com

> Chris Carr <cc...@havant.xyratex.com> wrote in message
> news:388C82CE.4F7E2266@havant.xyratex.com...
> > Hi,

> > I have a Client connecting to a remote server - both written in Delphi.

> > If I manually start the Server first on the remote machine, the client
> > happily connects,
> > calling methods on the remote object and sinking events from it.

> > If I allow COM to start the server on the remote machine, the events
> > don't make
> > it back to the client.

> > The server create/connect code in the client is:

> >           CardServer:=CoCard.Create;

> >       {Connect card server event to sink}
> >       FCardEventSink := TCardEventSink.Create(Self);
> >       InterfaceConnect(CardServer, _ICardEvents, FCardEventSink,
> > FCardConnection);

> > The event code in the server is:

> > procedure Tcardserv.OnConfigStatus(eStatus: E_ANA_CONFIG_STATUS);
> >   var
> >     EC: IEnumConnections;
> >     ConnectData: TConnectData;
> >     Fetched: Cardinal;
> >   begin

> >     EC := GetConnectionEnumerator;
> >     if EC <> nil then
> >     begin

> >       {The following line fails in DCOM, is this server was n't
> > alreasdy running
> >        before client is launched}

> >       while EC.Next(1, ConnectData, @Fetched) = S_OK do
> >         begin
> >           if ConnectData.pUnk <> nil then
> >             begin
> >               beep;
> >               (ConnectData.pUnk as
> > _ICardEvents).OnInitializeStatus(Toleenum(eStatus));
> >             end;
> >         end;
> >     end;

> >   end;{procedure TfrmPaPlus.OnConfigStatus}

> > Thanks for any help.

> > Chris Carr.

Other Threads