CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    221

    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

  2. #2
    Join Date
    Mar 2005
    Location
    On the Dark Side of Moon
    Posts
    86

    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

    Problem Is An Opportunity To Do Your Best.

    All Code Guru Member's
    Poll : -Please Vote For Code Guru Forum Programming competition


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured