DCOM problems

I've been trying to learn how to do DCOM and have run into a problem.

Current I made a server app that just sends a windows message to another program I made. these both run on the same pc.

I then made a client which calls the method from the server app and this all works fine.

I then tried to run the client on another machine (after running the server app so as to register it) and it don't work :/ I ran dcomcnfg and found my dcom class thingy and changed it so it tried to run from the server computer but that don't work either. Here's the code for the server and client. (This works fine when both run on the local machine)


Server
---------------------------------------

interface

uses
  ComObj, ActiveX, srv3_TLB, StdVcl, messages, windows;

Const
   EX_START = WM_USER + 100;

type
  Tgdh = class(TAutoObject, Igdh)
  protected
    procedure startexo; safecall;
    { Protected declarations }
  end;

implementation

uses ComServ;

procedure Tgdh.startexo;
var
   hwnd  : THandle;
begin
   hwnd := FindWindow(Nil, pchar('gdhServer'));
   if hwnd <> 0 then
      SendMessage(hwnd, EX_START, 0, 0);

end;

initialization
  TAutoObjectFactory.Create(ComServer, Tgdh, Class_gdh,
    ciMultiInstance, tmApartment);
end.
---------------------------------------


client
---------------------------------------
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, srv3_TLB, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
   srv: Igdh;
begin
   srv := Cogdh.CreateRemote('172.24.201.10');
   srv.startexo;
   srv := nil;
end;

end.
----------------------------------------------------


Thanks for any help :)

Gareth
LVL 1
Gareth_HastingsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ziolkoCommented:
Is there Delphi installed on client's machine?? whats the error message?
ziolko.
0
ziolkoCommented:
..one more thing add TDCOMConnection and try connect to server in design mode (set computername and servername/serverGUID). more info on http://www.distribucon.com/dcom.html
ziolko.
0
Gareth_HastingsAuthor Commented:
There is no error message when the client is compiled on the remote machine. Adding a TDCOMConnection and setting it to connect to the remote machine and adding the GUID and then setting connect to true doesn't give any errors either.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

ziolkoCommented:
If theres no error with TDCOMConnection in design time, try same thing in runtime after setting DCOMConnection's Connected propoerty to True call remote method
DCOMConnection.AppServer.yuormethod, some error must be thrown out :-)
ziolko.
0
Gareth_HastingsAuthor Commented:
right I have these 2 lines


DCOMConnection1.Connected := true;
DCOMConnection1.AppServer.startexo;


these cause no errors when run, but what happens now is I run the client the server opens and then doesn't appear to execute the "startexo" method. But when run from the remote machine the server app doesn't even appear to start or at least the form didn't pop up on the server computer like it did when run locally.
0
Gareth_HastingsAuthor Commented:
ok this is probably something simple but its annoying!! I don't suppose I could get a small example off you please? of a client/server app?
0
ziolkoCommented:
sure post here Your email I'll send You something.
ziolko.
0
Gareth_HastingsAuthor Commented:
great thanks

gareth@netgs.co.uk
0
ziolkoCommented:
I'll send You samoething later in the evening, Hope You dont mind.
ziolko.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gareth_HastingsAuthor Commented:
sure np
0
Gareth_HastingsAuthor Commented:
excellent help, thanks loads
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.