I want to pass a class between a GCC compiled gui app and MSVC dll ?
I want my GUI app to communicate with a plugin DLL,
example:
(Edit i think i wasnt clear. i know this wont work. this is PSEUDOcode. what i asked for is how to make it work and that isint really related to what classes i have :D)
class eventbase{ }//virutal copy constructor [edit:cloner .o0]
class eventtype1{} // copy constructor [edit:cloner .o0]
class eventtype2{} // copy constructor [edit:cloner .o0]
and pass these events from/to gui/dll …
i am afraid (well certian actually) this wont work so i ask for a workaround. how do you construct events to pass to your plugins ? how do you manage them ?
The problem is in linkage and C++ mangling. GCC and MSVC don’t result in same-named symbols within the DLL. The only way around it that I know of is to use C linkage of functions and structures to set up the interface between the application and the plugin DLL. Something like:
Unfortunately, this means that you won’t be able to pass STL collections or other more complex classes around. I hope you find a better answer than this, though. I’ll keep my eyes open for it.