I never tried ckRunningInstance until today, and it's not working for me 
either!  I mostly use late binding, so that's different from what you're doing 
too.

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Leslie 
Luyt
Sent: Friday, September 02, 2005 5:08 PM
To: [email protected]
Subject: [delphi-en] Registering COM Automation Server

Hi again
 
I am developing the program on Windows XP with Service Pack 1 installed.
 
The Client code appears as follows:
 
 
procedure TfrmXComNetCtrl.FormCreate(Sender: TObject); var Obj: IUnknown;
    hr : Integer;
begin
{  OleCheck(GetActiveObject(CLASS_XComNetServer, nil, Obj));
  If Obj <> nil then F := Obj as IXComNetServer
  Else Caption := Caption + ' - not Connected.';
//  fXObject := '';    }
end;

procedure TfrmXComNetCtrl.Button2Click(Sender: TObject); var  TypeLib : 
ITypeLib; begin
  F := TXComNetServer.Create(Application);  (* F is the installed component - 
installed from the Type Lirbrary *)
  F.ConnectKind := ckRunningInstance;
  F.Connect;                  (* This line always fails - Running Instance of 
server could not be found *)
  F.StartServer;                (* Procedure on the server com Object *) 
{  OleCheck(LoadRegTypeLib(LIBID_XComNetServer, 1, 0, 0, TypeLib));

end;

Initialization
  RegisterClass(TfrmXComNetCtrl);
  CoInitialize(nil);
Finalization
  CoUninitialize;
  UnRegisterClass(TfrmXComNetCtrl);
end.
The Button2 procedure is what I am currently trying to use, since the method in 
FormCreate is not working.  I know that the server is running, I can see the 
icon in the system tray.  The server also never returns S_OK when trying to 
register it in the ROT (Running Object Table), so I don't see why 
GetActiveObject should fail. 
 
Any suggestions or help or solutions of any kind will be greatly appreciated.
\r\n
\r\nThanks in Advance
\r\nLeslie Luyt

 
",1]);//-->
Thanks in Advance
Leslie Luyt

 
- Show quoted text -
\r\nOn 9/1/05, Smith David G (Finance) <[EMAIL PROTECTED]> wrote:\r\nCould you 
send some sample code from the client?  Also, what is the Windows version?

David\r\n

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Leslie 
Luyt
Sent: Thursday, September 01, 2005 4:38 AM
To: [EMAIL PROTECTED]
Subject: [delphi-en] Registering COM Automation Server

Hi

I have built an automation server in Delphi 7 and am trying to develop a com 
client for it, however whenever I try to connect to the com object,\r\n OLE 
returns the message "A running instance of the server {Guid} could not be 
found".  I know the com server is running (I set it to show an icon in the 
taskbar), I also know that RegisterActiveObject has\r\n succeeded as it retuns 
S_OK (I wrote its output to a text-file).
I currently trying to use GetActiveObject to retrieve the server\'s instance.  
I have tried installing the Automation server type library into delphi and 
including the component on my form, yet I still receive\r\n the same error.

Any advice or suggestions are welcome.

Thanks in Advance
Leslie Luyt
\r\n\r\n
",0]);//-->- Hide quoted text -
On 9/1/05, Smith David G (Finance) <[EMAIL PROTECTED]> wrote: Could you send 
some sample code from the client?  Also, what is the Windows version?

David 

-----Original Message-----
From: [email protected] [mailto: [EMAIL PROTECTED] On Behalf Of Leslie 
Luyt
Sent: Thursday, September 01, 2005 4:38 AM
To: [email protected]
Subject: [delphi-en] Registering COM Automation Server

Hi

I have built an automation server in Delphi 7 and am trying to develop a com 
client for it, however whenever I try to connect to the com object, OLE returns 
the message "A running instance of the server {Guid} could not be found".  I 
know the com server is running (I set it to show an icon in the taskbar), I 
also know that RegisterActiveObject has succeeded as it retuns S_OK (I wrote 
its output to a text-file).
I currently trying to use GetActiveObject to retrieve the server's instance.  I 
have tried installing the Automation server type library into delphi and 
including the component on my form, yet I still receive the same error.

Any advice or suggestions are welcome.

Thanks in Advance
Leslie Luyt



                
---------------------------------
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre.

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> Get 
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to