Link to home
Start Free TrialLog in
Avatar of DACHSE
DACHSE

asked on

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 :).
Avatar of George Tokas
George Tokas
Flag of Greece image

>>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.
Addition:
The COM equal application can, and its better be, a service....

George Tokas.
Avatar of DACHSE
DACHSE

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of George Tokas
George Tokas
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial