tt*******@yahoo.com (jonathan) wrote in message news:<f0**************************@posting.google. com>...
This is an ISO C++ newsgroup, which doesn't even support GUIs, let
alone loading arbitrary code at run-time (which some systems do not
support).
Then again, I'm not sure if there *is* a forum for this, so I'll start
rambling so that you have some stuff to look up, at least.
Anyone interested only in ISO C++ should probably stop reading now. :)
I'd like to implement an application that is truly dynamic: the
components are not only just known at runtime, but also the components
are unknown at runtime: ie: some don't even ship with the application.
There must be, at least, a published interface/protocol so that you
can ask the module what it can do and how to get it to do that.
Also, I need this to be cross-platform so, if there is no internal
solution to this problem (the language doesn't support it) I'm
interested in solutions that work on MacOSX/Linux/Win. I'm using
wxWindows as my GUI platform.
Java apps use a feature called "reflection" for this purpose; but C++
doesn't support anything like reflection (yet), so this has to be done
by the programmer. Further, ISO C++ doesn't support dynamic modules,
since not all systems support dynamic modules (ISO C++ is designed to
run on just about any computer). So, you're left with OS-specific
technologies.
On Windows, COM and ActiveX are commonly used for this sort of thing.
On Linux, GNOME uses Bonobo, which is a CORBA-based technology; and
KDE uses KParts.
I have no idea about MacOS X. :) Maybe, if you're lucky, one of the
Linux technologies is also portable there.
You might be able to use one or more of these technologies, perhaps
using different ones on different platforms. Alternatively, it may be
possible to write your own component architecture, but such will be
non-trivial (for a place to start, look up LoadLibrary on Windows and
dlopen on Linux [and possibly MacOS X via its FreeBSD heritage]).
Or - should I maybe go with wxPython instead?
That sounds like the easiest way to do it, if that'll work for you. It
certainly makes sense to use a dynamic language like Python to add
dynamic behavior to a program.
In fact, you might be able to write the program and modules in C++ and
use Python to glue them together -- those wacky people at boost.org
have a C++/Python reflection library, which may be of some use here.
It officially supports Windows and Linux, but it may be portable to
MacOS X if someone (you?) makes it happen.
I have no idea if any of this is relevant to you, but hopefully it'll
lead you in the right direction.
Good luck!
- Shane