mfc - how to read RUNTIME_CLASS info from dll -


we have 1 legacy mfc project (exe) use sth implement_serial(itema, baseitem, 0) serialization, found itema involve view operation, decided separate persistence part individual module (dll). exception raised when try deserialize external file after applying changes.

i found implement_serial macro did sth registration locally below:

#define implement_serial(class_name, base_class_name, wschema) \     cobject* pascal class_name::createobject() \         { return new class_name; } \     extern afx_classinit _init_##class_name; \     _implement_runtimeclass(class_name, base_class_name, wschema, \         class_name::createobject, &_init_##class_name) \     afx_classinit _init_##class_name(runtime_class(class_name)); \     carchive& afxapi operator>>(carchive& ar, class_name* &pob) \         { pob = (class_name*) ar.readobject(runtime_class(class_name)); \             return ar; } 

the persistence part separated individual module should register sth in dll, not accessed exe, there way read these runtime_class info? or shall make individual module static library instead of dll?

thanks in advance.

the runtime class implementation works dlls if have extension dll. see msdn.

a standard dll doesn't share classes other modules (here exe).

when extension dll initialized placed resource chain. , includes cruntimeclass object list. final thing done inside afxinitextensionmodule , constructor of cdynlinklibrary.

just code wizard creates extension dll.

remember using features inside dll requires mfc used dll.

creating static library fix problem if use such code in lot of modules better extract code in dll , use mfc shared resource.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -