通过 SendMessage API 访问 MS Tree Control 导致应用程序在 Citrix 演示服务器客户端中崩溃

发布于 2024-09-06 18:01:53 字数 564 浏览 11 评论 0原文

有人有这方面的经验吗?

我有一个由第三方编写的应用程序,它使用 SendMessage API 调用来使用 Visual Basic 6 附带的树控件的扩展功能。

这一切在桌面上和 Citrix 下运行良好(并且已经运行了 3-4 年) 4 在 Windows 2000 Server 上。在我们当前的 Windows 2003 Server 上的 Citrix 5 设置下,它可以在控制台中正常工作,但在演示服务器客户端中;当 SendMessage() 调用与 TVM_GETITEM 或 TVM_SETITEM 消息一起使用时,整个应用程序崩溃,没有错误消息,没有日志条目,什么也没有。

我在 Citrix 下构建了一个 VB6 开发环境,当您在演示服务器客户端下单步执行代码时,取出 IDE 也会发生同样的情况。

我通常会期望传递给 SendMessage() 调用的参数结构中出现错误,但 VB6 无论如何都非常不稳定,所以我认为它每次都会在 Windows 上失败。 Citrix客户端下肯定有区别。

我在 Google、Citrix 网站等上找不到任何有关该问题的参考。

任何指针、想法建议等均表示赞赏。

Does anyone have any experience with this?

I have an application written by a third party that uses the SendMessage API calls to use extended features of the Tree Control as shipped with Visual Basic 6.

This all works fine (and has done for 3-4 years) on the desktop and under Citrix 4 on Windows 2000 Server. Under our currrent setup Citrix 5 on Windows 2003 Server it works fine from the console but in the Presentation Server Client; when the SendMessage() call is used with the TVM_GETITEM or TVM_SETITEM message the entire app crashes, no error messages no log entries, nothing.

I have built a VB6 dev environment under Citrix and, when you step through the code under the Presentation Server Client, the same thing happens taking the IDE out as well.

I would normally expect an error in the parameter struct passed to the SendMessage() call but VB6 is pretty twitchy anyway so I would have thought it would fail on Windows every time. There must be a difference under the Citrix client.

I cannot find any reference to the problem on Google, Citrix website, etc.

Any pointers, ideas suggestions, etc. appreciated.

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

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

发布评论

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

评论(2

愛放△進行李 2024-09-13 18:01:53

我对 Citrix/Presentation 服务器一无所知,但最后的选择之一可能是尝试 VB5 通用控件库 (comctl32.ocx) 中的树视图。

(我建议这样做只是因为 VB6 树视图 (mscomctl.ocx) 与“核心”win32 公共控件树视图 (comctl32.dll) 无关 - 它是一个完全自定义的实现,因此对 Treeview API 的支持有限(不能例如设置后/前颜色),而 VB5 版本则使用真实的东西。

I don't know anything about Citrix/Presentation server, but one option of last resort open to you may be to try the treeview from the VB5 common controls library (comctl32.ocx).

(I only suggest this because the VB6 tree view (mscomctl.ocx) is unrelated to the "core" win32 common controls treeview (comctl32.dll) - its a completely custom implementation and so has limited support for the treeview API (can't set back/fore colours for example), whereas the VB5 version uses the real thing.

雪花飘飘的天空 2024-09-13 18:01:53

确保通过以下方式限制 mask 来仅检索 TVITEM 属性:

.mask = .mask And &H7F

... 在调用 SendMessage 之前。您不能在那里打上 &FFFF 或 -1 ,因为 TVM_GET/SETITEM 期望在较新版本的公共控件中具有扩展的接收缓冲区。该结构的新版本已重命名为 TVITEMEX

Make sure you are retrieving only TVITEM attributes by limiting mask this way:

.mask = .mask And &H7F

... before calling SendMessage. You can't slap an &FFFF or -1 there, because TVM_GET/SETITEM expect an extended receiving buffer in newer versions of common controls. The new version of the struct is renamed to TVITEMEX.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文