zoukankan      html  css  js  c++  java
  • Windows 右键扩展菜单实现中遇到的问题

    Windows 右键扩展菜单实现中遇到的问题
     
    1. 右键扩展实现目标
     
    实现效果如下:
     
        对于文本文件点击右键,在右键菜单中出现“SimpleShlExt Text Item”菜单项。
     
    2. 开发环境
        Windows7  32位
        VS2005
        
    3. 教程与参考资料
        《Windows Shell扩展编程完全指南》        请按照该指南的第一个例子做。
        《ATL开发指南》(用于补充学习)
     
     
    4. 遇到问题
     
    A.  Shell COM 从 VC6 移植到 VC2003或2005报错
          error C2787: 'IContextMenu' : no GUID has been associated with this object
        error C2440: 'initializing' : cannot convert from 'DWORD_PTR' to 'const IID *'
        error C2440: 'initializing' : cannot convert from 'ATL::_ATL_CREATORARGFUNC (__stdcall *)' to 'DWORD_PTR'
         根据博客《Shell COM 从 VC6 移植到 VC2003或2005的问题 》中的解释:
        There are two <comdef.h> header files in VC.NET, one in Vc7/include and the other in Vc7/PlatformSDK/include. 
        The former splits off the smart pointer typedefs into comdefsp.h, and it doesn't include IContextMenu. The latter does.
        You can try to #include the PlatformSDK header directly, change your INCLUDE path order。
     
        所以下载windows较新的PlatformSDK , 5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm,可以从微软官网直接下载
        安装后C:\Program Files\Microsoft Platform SDK\Include
        打开comdef.h文件,可以看到缺失的GUID。
        
     
           调整include路径
            VS2005->Tools->Options
            
     
    B. 编译后,注册后仍没有效果
        
        通常VS2005生成的rgs文件包含了下面的内容
     
        而这三项仅仅是向注册表注册了你开发的DLL,而Explorer还不知道,也不知该在什么时候调用。
        所以要增加下面的内容。
            修改rgs文件,增加上面的内容。
            注册后,在注册表中,可以看到下面的内容。
         
        解决完这两个问题,我的右键菜单扩展功能已实现。
     




  • 相关阅读:
    卷积,特征图,转置卷积和空洞卷积的计算细节
    keras中的shape/input_shape
    用”人话”解释CNN —— 对单个特征图进行视觉化
    MINST手写数字识别(三)—— 使用antirectifier替换ReLU激活函数
    MINST手写数字识别(二)—— 卷积神经网络(CNN)
    [LeetCode] Sqrt(x)
    [LeetCode] Text Justification
    [LeetCode] Valid Number
    [LeetCode] Minimum Path Sum
    [LeetCode] Unique Paths II
  • 原文地址:https://www.cnblogs.com/lqxinxin/p/3128222.html
Copyright © 2011-2022 走看看