Interface to my Program

I would like to seek some advice as in general terms how proceed with my current program, written as a MFC Dialog (C++) application in Visual Studio .Net.

I have developed it over the last few months as an application which creates its own internal database a large array of a user defined structure. I can access this data by two means; by name or index (0 to n).

Now I need to provide an interface to this array (database) so that I can write other applications to use this database along side my program.

So my question is

What sort of interface should I provide?

and

How to implement it? i.e. do I need to protect the data during access etc

I have never written any DLLs, just used them, also currently think of using the database item name as the access key and would like the option to write these programs in C or C++, so I question the use of CString as the database names are held in a CStringArray.

Any comments greatly appreciated.

Comments

  • you have a coice of either DLL or static linked library. If you go the DLL route you have to distribute the DLL along with your program(s), and it will not be portable to other operating systems, such as Linux or Unix.


  • Thanks for your post, just on additional question, if I go the Static Library way, do I need to consider protection of the data from my program updating the database and another program (via the libray) reading/writing to/from the database.

    regards,
    Andy
  • : Thanks for your post, just on additional question, if I go the Static Library way, do I need to consider protection of the data from my program updating the database and another program (via the libray) reading/writing to/from the database.
    :
    : regards,
    : Andy
    :

    yes -- you will need some sort of file locking mechanism. In Windows you could use a named mutex as described in MSDN which would synchronize file access across processes.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories