Hello,
First off, I must admit I have never really worked with DLLs before. Anyway I have a simple (more or less) question regarding those DLLs.
Okay, I have a main program "main.exe" which is the actual application. Now in its source code there's a class "AbstractModule".
Now I want to subclass from this abstract module class to create some real modules for my application and put that subclass into a separate file (i.e. DLL). Let's assume that module is "class TestModule : public AbstractModule" and the DLL is named "test.dll".
My main.exe application now receives a request for the module called "test" (dynamically). It knows that it has therefore to look for the file "test.dll" in the modules directory. Now of course main.exe somehow needs to initialize the module but of course it doesn't know that the actuall class is "TestModule", it only knows that it is a subclass of AbstractModule and for the initialization it only needs some of the virtual functions of AbstractModule.
So basically my problem is to load (dynamically... what I mean by that is that just imagine the user types the word "test" into a QLineEdit and now the application has to load the module "test" from the "test.dll") that subclass and initialize it. As previously said, the class in the test.dll is a subclass of AbstractModule and the main.exe doesn't care how the subclass is named or what it is, it only needs to know that it is of AbstractModule.
So, how do I realize that?
Well, long text but I just wanted to clear everything up
Thank you in advance
Bookmarks