动态加载DLL导出的数据
Load DLL exported data dynamically
是否有导出数据的GetProcAddress版本?
我想这样做:
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();
}
也就是说,定义UDT("MyDataType")的导出数据("Here"),并在动态加载DLL时获取其地址。这可能吗?
msdn页面说"从指定的动态链接库(DLL)中检索导出函数或变量的地址。"-即it should Just Work(tm)
相关文章:
- 我的程序有一个保存配置文件的GUI,如何双击此配置文件以直接加载带有配置数据的GUI?
- 有效地将数据加载到 std::vector 中<char>
- C++WIN32-将RTF数据加载到Rich Edit控件
- 增强序列化,按基类型加载存档类会产生错误的数据
- 将数据从 c++ 加载到 QML Scatter3d 项
- 如何将训练数据从UCI加载到OpenCV?
- 将数据保存在C++中,从 Python 加载 - 推荐的数据格式
- 加载并从文件C 中加载大量的结构化数据
- 使用ifstream从DAT文件加载数据
- 将数据预加载到RAM中进行快速交易
- 从 CSV 文件读取并尝试将数据加载到由结构组成的矢量中
- 编译器优化如何影响数据加载速度
- ATL ActiveX DLL 作为映射类型图像和数据加载了两次
- 将游戏数据加载到没有全局变量的池中
- 如何从原始数据加载 devIL 映像
- libxml-从原始数据加载xmlDoc
- 将数据加载到内存中以获得更快的响应
- 将位图数据加载到OpenGL纹理中的问题
- 将大量二进制数据加载到RAM中
- 用Qt从原始数据加载图像