c++ - Load DLL exported data dynamically -


is there version of getprocaddress exported data?

i like:

mydll.cpp:

mydatatype::mydatatype(long, wchar_t*) {     //dummy code     this->temp = 3; } __declspec(dllexport) mydatatype here(50, l"random text"); 

myclient.cpp:

int main(void) {     hinstance hdata = loadlibrary("mydll.dll");     reinterpret_cast<mydatatype*>(getdataaddress(hdata, "here"))->dosomething(); } 

that is, define exported data ("here") of udt ("mydatatype"), , them obtain address when dll dynamically loaded. possible?

the msdn page says "retrieves address of exported function or variable specified dynamic-link library (dll)." - ie should work(tm)


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -