在Message Box Husing手柄中显示DLL的路径
Show path to a dll in a MessageBox husing handle
i用此命令加载dll
HINSTANCE DllEconovent = LoadLibrary(_T("Econovent.dll"));
我想从磁盘上加载DLL的位置...在此假案例中
C:TFS_FWGAconOembinEconovent.20140130_3200Econovent64Econovent.dll
,只需显示消息框
MessageBox(_T("No valid ProcAddress"), _T("Error"), MB_ICONINFORMATION);
这是如何以最佳方式完成的?
有一个查看GetModuleFileName
:此功能"检索包含指定模块的文件的完全合格的路径。"
DWORD WINAPI GetModuleFileName(
_In_opt_ HMODULE hModule,
_Out_ LPTSTR lpFilename,
_In_ DWORD nSize
);
它应该接收您的HINSTANCE
对象并给您一个文件名。
一个简单的示例
int main()
{
HINSTANCE test = LoadLibrary("test.dll");
char buffer[MAX_PATH];
GetModuleFileName(test, buffer, MAX_PATH);
std::cout << buffer << std::endl;
return 0;
}
将其调整到MessageBox
,只需使用std::cout
删除线并放置
MessageBox(buffer, _T("Error"), MB_ICONINFORMATION);
相关文章:
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 挂起和取消挂起一个文件DLL
- 字符串-C++后显示的随机字符
- 继承期间显示未知行为的子类
- 仅使用绝对值对数组进行排序,并在C++中显示实际值
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- 导入库可以跨dll版本工作吗
- 如何在C++的程序中显示Windows的"DLL not found"错误?
- 使用转储箱显示 DLL 的外部符号 (UNDEF)
- 在Message Box Husing手柄中显示DLL的路径
- C++ Dll in Dependency walker 显示了 IESHIMS.dll 和 MSVCR110.dll
- 使用 DLL 运行时,按钮上不显示位图
- 在Qt错误显示:"Fault Module Name: Qt5Cored.dll"在win 7和调试时:"segmentation fault"在CentOS Linux和Win 7中
- DLL导出查看器显示函数的完整签名-无法从Java调用它们
- 为什么依赖跟踪器显示丢失的dll
- 向远程进程注入DLL并显示信息
- Win32 DLL窗口未显示
- 通过.rc文件设置dll属性:Windows 7显示哪些属性
- 显示MFC DLL中的对话框