Dynamic loading of classes.
> First of all, apologies if this is the wrong group for this - but this one
> seems a bit more friendly towards new posters than comp.lang.c++...
> I have an app that applies effects to wave files. Each effect is, at
> present, a class included in the main source, statically linked at compile
> time. I'd like to be able to develop the effects separately from the main
> app, and load them at run time.
> Can anyone give me a pointer as to how this could be done?
I'd probably decide to put the effects on dlls. Each dll would have a known
exported function that acted as class factory for the class, and that would
give you a pointer to the effect class. It's simple and easy to implement.
If you'd like to go a little bit farther, you can use COM for this, it's
pretty well suited for that kind of task (many people avoid com as much as
they can,though, me included sometimes <g>).
Also, it's worth noting that you can export the classes directly from your
dlls, but there are problems with that approach (versioning, etc) that I
prefer to avoid.