|
-
December 21st, 2005, 03:27 PM
#1
Windows Service and sharing connectivity across the Program
Hi,
We are using a COTS (Commercial Off the shelf software). This software package has a database and an front-end application. They have provided an API for external applications to access the data from database.This API comes as Windows service.
When i want to programmatically make a connection via API. I create an instance of API and just say connect
Code:
IAPIPtr m_APIObject;
m_APIObject.CreateInstance(__uuidof(APIName));
m_APIObject->Connect("test","test12");
There are 4 external programs we have written to inegrate with the third-party application . Each of these application are self-contained and each of them make their own instance of the API and connect to it. Since we have only API connection license, when one application is running, the remain 3 shut-down.
We want to share the API connection across the programs. Can this be done ? If yes, how can this can be done ?.
Code:
----------- -------------
| Prog1 | | Prog2 |
| | | |
---------- -------------
| |
| |
V V
------------------------------------------
| Common API Connection |
| |
-----------------------------------------
Thanks in advance
-
December 21st, 2005, 11:52 PM
#2
Re: Windows Service and sharing connectivity across the Program
hi ,
well it is not possible to share connection form the .dll because Dll function
call are in-process function calls it means dll will be loaded in the same
memory location of the calling programm.
ok now you want to share a connection try to find out if the connection
can be open by ODBC instade of Api call , in ODBC by connection pulling
you can restrict number of connection open and re-use of existing
connections.
hope it helps
Regards,
x8086
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|