Are class definitions constant?
-
Hello! I'm currently writing some plugin framework. The plugins are implemented as simple DLLs. The main application has some class A. It passes a pointer to this class to the DLL. The DLL knows the class (it can include the header file of A) and can now perform operations with it. Now, what happens if the class extends (a developer adds a function or variable for example) and the main application gets recompiled? Will the DLL still be able to access the class? Of course it cannot know the new functions or variables. But will the old functions still be accessible or are they completely incompatible now? Thanks in advance and best regards
-
Hello! I'm currently writing some plugin framework. The plugins are implemented as simple DLLs. The main application has some class A. It passes a pointer to this class to the DLL. The DLL knows the class (it can include the header file of A) and can now perform operations with it. Now, what happens if the class extends (a developer adds a function or variable for example) and the main application gets recompiled? Will the DLL still be able to access the class? Of course it cannot know the new functions or variables. But will the old functions still be accessible or are they completely incompatible now? Thanks in advance and best regards
I think If your class is not having any virtual functions inside or any other mechanism like COM does...then It will work fine...otherwise it won't
-
Hello! I'm currently writing some plugin framework. The plugins are implemented as simple DLLs. The main application has some class A. It passes a pointer to this class to the DLL. The DLL knows the class (it can include the header file of A) and can now perform operations with it. Now, what happens if the class extends (a developer adds a function or variable for example) and the main application gets recompiled? Will the DLL still be able to access the class? Of course it cannot know the new functions or variables. But will the old functions still be accessible or are they completely incompatible now? Thanks in advance and best regards
Provided you don't move the variables around within the baseclass you should maintain ABI (Application Binary Interface), google should be a good starting point for getting information specific for your compiler. As the previous poster pointed out, one one to do this is to use an approach like that of COM, with interfaces for versioning rather than changing implementations. If this is for an in house product it's probably not worth worrying about. Recompile everything to be safe if you're not sure. If you're selling it to other developers look for a more robust way of doing this, COM or XCOM.
If you can keep you head when all about you Are losing theirs and blaming it on you; If you can dream - and not make dreams your master; If you can think - and not make thoughts your aim; Yours is the Earth and everything that's in it. Rudyard Kipling