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
Post a Comment