如何在 C++ 中编写 shell 扩展上下文菜单建造者2010?

发布于 2024-08-17 12:47:39 字数 290 浏览 4 评论 0原文

我正在寻找一些在 C++ Builder 2010 中编写 shell 扩展的示例(2007 和 2009 也可能相关),以便我可以右键单击资源管理器中的文件并获取我的 VCL 程序中的文件路径。

我已经遵循了 Clayton Todd 的教程,但它是 2001 年的,我在获取它时遇到了一些麻烦工作。我无法让它调用我的方法(initialize、QueryContextMenu 等)。

I'm looking for some examples for writing a shell extension in C++ Builder 2010 (2007 and 2009 would also probably be relevant) so I can right click a file in Explorer and get the file path in my VCL program.

I have followed Clayton Todd's tutorial, but it's from 2001, and I have some trouble getting it to work. I can't get it to call my methods (initialize , QueryContextMenu etc.).

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

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

发布评论

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

评论(1

夏了南城 2024-08-24 12:47:39

多年来,Delphi 和 C++ Builder 都包含一个示例项目(在 ActiveX\ShellExt 中),该项目将“编译”项添加到项目文件的上下文菜单中。你应该从那开始。另请阅读有关如何创建上下文菜单处理程序的 MSDN 讨论。

总的来说,我建议不要在 shell 扩展中使用大部分 VCL。保持较小。它要做的就是实现基本的 IContextMenu 方法,然后将其收集的文件名发送到您的主程序。

如果您已按照教程进行操作并阅读了文档,但某些方法仍然没有被调用,那么请进行一些调试以找出原因。问问自己:正在调用哪些函数? DLL 是否已被加载?

For many years Delphi and C++ Builder have included a sample project (in ActiveX\ShellExt) that adds a "compile" item to project files' context menus. You should start with that. Also read the MSDN discussion on how to create a context menu handler.

Overall, I recommend not using much of the VCL in your shell extension. Keep it small. All it's going to do is implement the basic IContextMenu methods and then send the file names it collects to your main program.

If you've followed the tutorial and read the documentation and some of your methods still aren't being called, then do some debugging to figure out why. Ask yourself: Which functions are being called? Is the DLL getting loaded at all?

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