Dynamically create object of DLLs form Factory - C++ -
hi have 6 projects defined in ide.
- eventhelper
- configparser
- officeeventhandler
- messaging
- loggingandpersistence
- screencamera
eventhelper has entry point. rest of projects dll gets absorbed eventhelper.
messaging , configparser being used in every other dlls well. code loading dlls , acessing common in modules (code redundancy).
dllhandle_parser = ::loadlibrary(text("configparser.dll")); if (!dllhandle_parser){ return; } configparserclient_fctry = reinterpret_cast<configparser>(::getprocaddress(dllhandle_parser, "getparserinstance")); if (!configparserclient_fctry) { ::freelibrary(dllhandle_parser); return; } parser = configparserclient_fctry();
and similar code messaging
my question is there way can have 1 dll called objectfactory can give name of class (in runtime, in string format) created. objectfactory.getinstance("configparser/messaging")
. (java class.forname("classname")
)
or if not possible way, suggested architecture?
Comments
Post a Comment