Question

I have 2 desktop applications that I wish to integrate with external applications. One of the applications is extended with plugins which are developed by me, to provide specific features which are not common for all distributions. The situation can be described in the following diagram:

alt text http://img32.imageshack.us/img32/8902/integration1.png

As I mentioned, I want to integrate (receive and send data) my applications with external applications or SDKs. Usually there 2 types of data from external applications:

  1. General/Common data - which is always relevant
  2. Specific data - which should be handled differently for each external application

With "Core Application", the wanted situation can is described in this diagram:

alt text http://img32.imageshack.us/img32/3299/integration2.png

The General data is handled in the Core Application, and the specific data is handled in plugins (support plugins).

A distribution of this application might be one of

  • Core Application + Yakko App + Yakko App Integrator + Yakko App Support Plugin
  • Core Application + Dot App + Dot App Integrator

For the other application, I want to keep the same "Integrators", but to handle them differently inside the application:

alt text http://img32.imageshack.us/img32/2088/integration3x.png

How would you recommend to implement support in my applications for integrating external applications and SDKS, as I just described?

Notes:

  • I'm using C++ on Windows and the plugins are distributed as DLLs.
  • The data types that will be used are always known in advance, I just need some generic way to move it from the source to the handler.
Was it helpful?

Solution

I agree with the commenter, COM seems like a good strategy. Your support dlls get registered when they are installed, then your core app can look for plugins, something like:

hr = CLSIDFromProgID(L"Wakko.1.0", &clsid);  
hr = GetActiveObject(clsid, NULL, &punk);

or
hr = CoCreateInstance(clsid, ...,..., IID_IWAKKO, ...);

OTHER TIPS

Look at the IPC options that windows has here

To me as well COM looks like a good option here.

Another way to do this would be to have your core application running a server which listens to calls from your plugins. You can achieve this by using names pipes. Now, your support apps would use these plugins to communicate (over named pipes) with your core app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top