错误一:
VS2008错误:error PRJ0050: 未能注册输出,请确保您有修改注册表的相应权限。
工程设置的问题,VS2005建的STL工程中默认的设置是:
ALT的使用:动态链接到 ATL
配置属性->链接器->常规->注册输出: 是
改为:
ALT的使用:静态链接到 ATL
配置属性->链接器->常规->注册输出: 否
注:我已经是管理员登陆,对注册表有完全的操作权限。
附:
注册输出
运行 regsvr32.exe /s $(TargetPath),它仅在 .dll 项目上有效。对于 .exe 项目,忽略该属性。如果要注册 .exe 输出,在配置上设置生成后事件,以执行已注册的 .exe 文件始终要求的自定义注册。
错误二:
“mt.exe : general error c101008a: Failed to save the updated manifest to the file”
general error c101008a: Failed to save the updated manifest to the file ".\debug\MyShell.dll.embed.manifest". Bpomt.exe
解决的方法:点class view中的工程,选右鍵,再点clean就可以了; 或者是 build->clean solusion。
错误三:
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'
处理方法见:
http://blog.youkuaiyun.com/zaishaoyi/article/details/38453161
错误四:
注册dll时,在cmd窗口输入
Regsvr32 MyShell.dll
点击回车,注册失败。提示错误代码为0x80070005
这是因为Win7只以管理员权限登录还不具备完整的管理员权限,需要到C:\Windows\System32路径下,找到cmd.exe,右键单击选择以管理员身份运行。然后再输入之前的注册命令。