Methods and Properties from external objects


Recommended Posts

Hi,

Is it possible to read properties of objects in external dlls, or only function calls (methods)?

I have seen some old posts on wrapping ActiveX in a dll. Is there any restrictions on the dlls, will DF call functions from dlls implemented in C, C++, C# etc?

Thanks

Link to comment
Share on other sites

There are no restrictions on DLL's as long as the exposed interface is in C. Libraries we write is usually done in C++, with a C interface (using extern "C" {}). You could wrap an ActiveX in a DLL. You could even load an ActiveX library directly if you were very experienced in ActiveX since ActiveX exposes C functions.

OK, I guess there are a few restrictions then:

1) the interface has to be C

2) you can't pass objects, just native types or strings (which are just arrays of chars, so a native type)

3) you can't do a callback into DAQFactory.

4) if you are going to do any UI, you'll have to provide your own message pump

5) your library either needs to be thread safe, or you need to be real careful how you call it in DAQFactory since DAQFactory is quite multithreaded. We've seen people using non-thread commercial libraries and calling it from multiple sequences. Unfortunately with any threading issue, the problems don't always crop up immediately.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.