如何获取Windows SDK中的资源DLL代码示例并编译运行?

发布于 2024-08-22 20:03:33 字数 729 浏览 6 评论 0原文

我目前正在尝试在 Windows Server 2003 和 2008 上构建资源 DLL。我目前正在使用 Windows SDK 提供的资源 DLL 代码示例,但无法让它们工作。

在 Windows Server 2008 上,我成功编译了 Windows 7 SDK ClipBook Server 示例,但无法使其在集群中正常工作。当我使用“cluster restype /create /dll”将资源作为资源类型插入集群时,它可以工作,但该资源以未知类型列出,而不是剪贴簿服务器类型,因为我认为它应该具有资源 DLL 代码中定义的类型。 我也成功地创建了这种类型的资源,但我永远无法让它上​​线。我总是收到错误:

发生系统错误 5079 (0x000013d7)。 指定的节点不支持此类型的资源。这可能是由于版本不一致或由于该节点上缺少资源 DLL。

尽管该资源位于集群中的所有节点上,包括我尝试启动的节点,但情况仍然如此。资源上。

在 Windows Server 2003 上,我使用 Platform SDK 版本 5.2,甚至无法编译 ClipBook Server Resource DLL 代码示例。我总是收到 MIDL1001 错误,指出无法打开文件 cluscfgserver.idl。我将文件位置的路径添加到项目的包含路径中。那行不通。当我尝试对文件的路径进行硬编码时,在尝试链接该文件时遇到了几个链接器错误。

如果有人知道有关这些问题的任何信息,我将不胜感激。

I am currently trying to build a Resource DLL on on Windows Server 2003 and 2008. I am currently working with the Resource DLL code samples supplied with the Windows SDKs, and I can't get them to work.

On Windows Server 2008 I succeeded compiling the Windows 7 SDK ClipBook Server sample, but couldn't get it to properly work in the cluster. When I insert the resource as a resource type to the cluster using "cluster restype /create /dll" it works, but the resource is listed with an unknown type instead of a ClipBook Server type, as I think it should have as it is the type defined in the Resource DLL's code.
I also succeed in creating a resource of that type, but I can never get it to go Online. I always get the error:

System error 5079 has occurred (0x000013d7).
The specified node does not support a resource of this type. This may be due to version inconsistencies or due to the absence of the resource DLL on this node.

And this is despite the fact that the resource is located on all the nodes in the cluster including the one I try to start the resource on.

On Windows Server 2003, I'm working with the Platform SDK version 5.2, and I can't even get the ClipBook Server Resource DLL code sample to compile. I always get MIDL1001 Error saying that it cannot open the file cluscfgserver.idl. I added the path of the file's location to the include path of the project. That didn't work. When I tried to hard-code the path of the file, I got several linker errors when trying to link with this file.

If anyone knows anything about any of these problems, I would appreciate any input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惜醉颜 2024-08-29 20:03:33

这些例子已经过时且已被废弃。为了使类似的“文件共享示例”正常工作,我必须完成以下几件事:

  • 将项目转换为 x64(据说 32 位资源仍然可以工作,但我无法验证这一点)
  • 添加模块定义文件 (.def) 到链接器输入属性页,以便公开 Startup 函数
  • 代码中有几个位置使用 CompareString 检查资源类型名称,成功时预计返回 0,但实际上返回 CSTR_EQUAL< /代码> (3).
    • 这可能就是您获得“(未知类型)”名称的原因。

  • 要注册资源扩展,cluster.exe 不会接受 dll 名称中的空格,因此在我的情况下,我必须
  • 仅使用 cluster /REGADMINEXT:'FILESH~2.dll' 属性表扩展支持接口,自 Server 2008 起,其他所有内容(上下文菜单、向导)均已删除
  • 检查资源类型“ClipBook Server”的扩展 DLL stdafx.cpp 源。它应该是“ClipBook Server Sample”:const WCHAR g_wszResourceTypeNames[] = L"ClipBook Server Sample\0"

Those examples are old and busted. Here are a few things I had to go through to get the similar "File Share Sample" to work:

  • Convert the project to x64 (supposedly 32 bit resources still work, but I haven't been able to verify that)
  • Add the module definition file (.def) to the linker input property page so that the Startup function is exposed
  • There were several spots in code where CompareString is used to check the resource type name and 0 is expected on success, but it actually returns CSTR_EQUAL (3).
    • This is probably why you get the "(Unknown Type)" name.
  • To register the resource extension, cluster.exe won't accept spaces in the dll name, so in my case I had to use cluster /REGADMINEXT:'FILESH~2.dll'
  • Only the Property Sheet extension interface is supported, everything else (context menu, wizards) has been removed as of Server 2008
  • Check the extension DLL stdafx.cpp sources for the Resource Type "ClipBook Server". It should be "ClipBook Server Sample": const WCHAR g_wszResourceTypeNames[] = L"ClipBook Server Sample\0"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文