Hello to all,
Are there any good articles on how to deal with loading of packages in C++ Builder dynamically out there that exposes class methods. I know that one uses LoadPackage to load a package dynamically, how the question comes to my mind of how to deal with class objects that have been defined as __declspec(dllExport) and gaining access to the methods that are exposed. I also know that there is the GetProcAddress but that seems a bit obscure given that all methods within a class are part of the VTable and should be resolved without getting a link failure, excluding (static member functions).
Traditionally, I have created my package/dll and used a static link. But now, I need to provide the ability to load dynamically such that I don't have to close my main application (PLC) in order to correct some I/O logic, thus I don't have to shut down the process line. The question is how exactly to do that.
I do know also that if, I define a base interface, for which the make application builds into itself, and I derive classes from that which are in the dll/package, then all links are happy, but then I am building in a module that is technically not part of the memory space of the main appliction but really in the dll/package. This seems a bit of a waste to me, to have to include the base code in the root application only to gain access to the derived class which of course also has the same code inside of the dll/package. There has to be a better way of dealing with this.
Thanks,
James