Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Are class definitions constant?

Are class definitions constant?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    One Stone
    wrote on last edited by
    #1

    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

    V A 2 Replies Last reply
    0
    • O One Stone

      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

      V Offline
      V Offline
      vikramlinux
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • O One Stone

        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

        A Offline
        A Offline
        Andrew Walker
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups