• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Binding COM client's to an existing COM server

Hello experts,
I need a remote Out-process COM server as executable exe or DLL program. All clients (local clients) should work with the same server-instance.

Actually I work with the C++Builder 2006 and created a COM automation object  which is merged in a C++Builder ActiveX-DLL-project.

With the type library of the server-object I created a Component-Wapper for the clients.

Running the application, the first client connects to the server-object with ConnectKind 'ckRunningOrNew'. The server starts and all is running fine. But when I try to start the second client with the ConnectKind 'ckRunningInstance' I get the exception: "Unable to retrieve a pointer to a running object" of my server. The server is definitely running. Actually I can only start clients with the ConnectKind 'ckRunningOrNew', so that all clients work with their own server instance. The project requires, that the server is running permanently and several clients can connect at the same time.

Now my Questions. Do I use the right COM technologie for this problem, or should I use other COM Components? Which project-settings in my server-project do I have to set, so that all clients connect one server-instance?

Thanks for your help.
Björn

Background information: We have developed a quit complex software and are now forced to develop a kind of application server, which should run specific tasks (for instance file import/ export) at a given time. Our idea is, that the user can generate this specific tasks with the help of a graphical development interface (http://www.nwoods.com/sanscript/tour/index.htm). This program can import TLB's and generate little executables wich can be scheduled. Actually these little executable connect to the COM Server, which is executing the specific task. If you have any other solutions for this problem, feel free to share :).
0
DACHSE
Asked:
DACHSE
  • 3
1 Solution
 
George TokasCommented:
>>Now my Questions. Do I use the right COM technologie for this problem, or should I use other COM Components?

I think you do...

>>Which project-settings in my server-project do I have to set, so that all clients connect one server-instance?

I think also that you didn't anything wrong...

My hamble oppinion is that when encounter this kind of problem you describe is to change a bit on design...
Try using classic TServer/TClient socket strategy... In BDS they have changed to TCP sockets...
Use the server app (the COM equal) with a server socket in non blocking mode, multithreaded, to serve the clients...
Limit the connections only to localhost(127.0.0.1) so no external PC can access the socket...

Consider it a bit...

George Tokas.
0
 
George TokasCommented:
Addition:
The COM equal application can, and its better be, a service....

George Tokas.
0
 
DACHSEAuthor Commented:
Hello,
>>My hamble oppinion is that when encounter this kind of problem you describe is to change a bit on design...
No, the problem exists directly without changing of the server design.

>>Try using classic TServer/TClient socket strategy
I already considered that. But the main problem is, that I need a typelibrary by my server. This typelibrary I need for the sanscript program. This program is like an graphical interfaces between user and server. It can import TLB's and generate little executables wich can be scheduled. So, you can control the server with the sanscript program. Therefore I need the server-typelibrary.

Regards,

Björn
0
 
George TokasCommented:
Before we go any further I have to state that this is WHAT I'M GOING TO DO WHEN I ENCOUNTER SUCH A PROBLEM...
And believe me in my programming life many times I change plans when progressing a project....
That means instead of wasting more time to solve the problem I'm trying to bypass it...
So....
>>But the main problem is, that I need a typelibrary by my server. This typelibrary I need for the sanscript program. This program is like an graphical interfaces between user and server. It can import TLB's and generate little executables wich can be scheduled. So, you can control the server with the sanscript program. Therefore I need the server-typelibrary.


The service can download the TLB and install or made the executables you want...
TDounloadURL is a component you can use for that.

George Tokas.
0
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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now