我有一个简单的应用程序,它使用Poco::Logger和Poco::EventLogChannel将日志消息写入EventViewer。
在我使用管理员权限运行我的程序之后,将创建HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog下的注册表键,CategoryMessageFile和EventMessageFile键将指向Windows/System32文件夹中的PocoFoundation.dll。我已经把dll复制到那个位置了。
但是在EventViewer内部会显示日志消息,但不会显示其他信息。它只是说:
无法从源RRWS找到事件ID 51001的说明。引发此事件的组件没有安装在本地计算机上,或者安装已损坏。您可以在本地计算机上安装或修复组件。 如果事件起源于另一台计算机,则显示信息必须与事件一起保存。 这次活动包括下列资料: 测试日志消息 存在消息资源,但在字符串/消息表中找不到消息。
对我来说,EventViewer似乎找不到dll。
有人知道怎么解决这个问题吗?
发布于 2021-07-07 06:17:54
在使用通过cmake构建的cmake时,似乎存在一个问题,因为cmake构建的cmake只命名为PocoFoundationd.dll和PocoFoundation.dll,但是在setUpRegistry()函数中的EventLogChannel.cpp中尝试加载PocoFoundation64d.dll,如下所示:
if (disp == REG_CREATED_NEW_KEY)
{
std::wstring path;
#if defined(POCO_DLL)
#if defined(_DEBUG)
#if defined(_WIN64)
path = findLibrary(L"PocoFoundation64d.dll");
#else
path = findLibrary(L"PocoFoundationd.dll");
#endif
#else
#if defined(_WIN64)
path = findLibrary(L"PocoFoundation64.dll");
#else
path = findLibrary(L"PocoFoundation.dll");
#endif
#endif
#endif这里也提到了:Poco发行3304
https://stackoverflow.com/questions/67943293
复制相似问题