views:

23

answers:

1

I need to adapt a simple function (let's say) int printText(string) written using an MFC library (this function prints the text on a particular printer whose driver lib is completely developed by MFC), to two applications developed the first in LabView and the second in Java (Eclipse RCP).

I've thought that an ActiveX component is the right choice that could fit well in both applications, but I don't know where to begin.

Is there any one that can guide me in developing this simple ActiveX without dealing with all the flexibilities (i.e complexities) of ActiveX world? My component should be invisible, nothing more than a print method that takes a string (and eventually another init method to initialize the printer).

+1  A: 

This greatly depends on the style in ActiveX is written in. Some frameworks can access them and other not. As far as I am aware, the following tools will help you (we use all of them in different contexts):

  • SWT (Has an OLE interface, good for ActiveX controls running in YOUR process)
  • Com4J (Great stuff for working with ActiveX components having its own thread, like remoting Word or Outlook)
  • JNative (Good for calling simple DLL function)
Daniel
Thanks a lot Daniel.At the moment my first problem is not the integration of an ActiveX in the Labview/RCP application; but is doing an ActiveX in the simplest manner. My ActiveX should be only a wrap of some function which will be called from Labview or java app
picciopiccio
The easiest way to create an activeX is using VB6. We love VB6 here, because it takes only a few lines of code to create a complete ActiveX if needed. In fact, VB was written just for COM and ActiveX, so there is no language suited better for that.
Daniel