Load DLL exported data dynamically
问题 Is there a version of GetProcAddress for exported data? I would like to do something 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 an exported data ("Here") of UDT ("MyDataType"), and them obtain its address when the DLL is