C++ Compiler independent Dll using abstract interface -
overflow community,
in company, want move away borland c++-compiler , embarcadero-ide. slowly, wanted make each dialog dll compiled microsoft visual studio c++-compiler. in dll have function (these functions should pop dialogs, here test)
extern "c" getselobjshared_export void printselectedobject(iatml *atml);
iatml interface , serves make callbacks our main-application written in borland, behind interface stands class atml : public iatml compiled in borland. thought might work because of http://www.codeproject.com/articles/28969/howto-export-c-classes-from-a-dll#cppmatureapproach).
now if call function main application, works if printselectedobject has following implementation
void printselectedobject(iatml *atml) { int selectedobject = atml->getselobj(); }
but line add makes programm crash, e.g.
void printselectedobject(iatml *atml) { outputdebugstring(l"trying call interface function!"); int selectedobject = atml->getselobj(); }
the interface contains 1 function, so
struct iatml { virtual int getselobj() = 0; }
so why doesn't work, there workarounds. can use com achieve same thing. appreciated.
Comments
Post a Comment