Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Binding COM client's to an existing COM server

Posted on 2006-05-30
6
Medium Priority
?
380 Views
Last Modified: 2013-11-17
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
Comment
Question by:DACHSE
  • 3
4 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 16792441
>>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
 
LVL 16

Expert Comment

by:George Tokas
ID: 16792458
Addition:
The COM equal application can, and its better be, a service....

George Tokas.
0
 

Author Comment

by:DACHSE
ID: 16796678
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
 
LVL 16

Accepted Solution

by:
George Tokas earned 500 total points
ID: 16797728
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question