Original Post
For my current project I''ve been working on a "dynamic class loader." This is basically a system for which I will *only* need the target DLL/SO to get full functionality of all the classes inside it. Usually you would need a .lib file as well but I don''t want to use one.
What my system does thus far is load the .dll/.so, search for an init function which passes a specific class pointers to the mCore and mClass (an empty class which acts as a shell for new classes retrieved from dlls) classes. Then the system searches for a new_pointer function and that function returns a pointer to the classes which I want inside the shared library.
So far I''ve gotten the init function to work correctly, it''s a bool so it returns a true or a false (which I''ve tested, so I know that it does in fact retrieve the function and run it). Now I need to figure out how to take the pointer to the newly retieved class and be able to access the functions within it.
Let''s say the pointer I got from new_pointer() is called myPointer. I want to do something like myPointer->MyFunction(); but myPointer (which is an mClass*), doesn''t have MyFunction() in it because MyFunction() exists in MyDLL.dll.
Which leads me to my question, how can I access these functions from the pointer if they don''t exist? I can''t compile it with the assumption that there will be that function when I try to call it, because you get errors when you do that.
Do I maybe need some way to add all of the functions within the class to a list of some sort? This is where I''ve absolutely gotten stuck :\
James Simmons
MindEngine Development
http://medev.sourceforge.net