Hi guys, I'm going to make my application extensible. Where I can read information about writing programs which support plugins? C++
your best bet is looking at something like Lua. It will allow you to have cross platform plugins and load code without having to start and restart your application. Dynamic code loading in C++ is very platform specific and non-portable without a tremendous amount of work.
A plug-in architecture is what you need to look-up and read about. A SO answer will not help beyond providing a few stray links. I'll try to explain as briefly as I can: Typically, plug-ins are a set of dynamic libraries that the host application loads (usually at start up, sometimes delay loaded for efficiency purposes). They then become part of the application and behave as if they were a native/core component. Hence, you need to rethink about your application's architecture and module design as well. Here are a set of questions you'll need to answer:
- What do you call the core?
- What do you want the plug-ins to do?
- What set of core functionality will the plug-ins need?
- If your application is cross-platform you'll need to make sure your plug-in APIs are cross-platform too -- which usually involves some work.
- Do you want the plug-ins to modify the UI? This opens up a whole new box of surprises.