看来今天运气不错,用半调子英文把错误信息转成" smart device, project creation failed" google了一下,很快就找着答案了。
Are you having issues creating native projects?
If you've tried to create a smart device Win32 project on Windows Vista or after installing IE7, you might have seen a failure with a message in the status bar saying "project creation failed". It's a known issue, and has been fixed in SP1, but if you can't install that, there's a workaround:
1. Close VS
2. Start RegEdit.exe
3. Find the following registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\PreApproved
4. Add a new entry and name it
{D
5. Close RegEdit
6. Start VS
7. Try to create a Smart Device C++ project
Thanks to Gangadhar on the VC++ for Devices team for the writeup, and Chris for posing the question on the Device MVPs discussion list.
原来又是IE在作怪,找把IE抛弃了,它还是来坑人,烦的狠啊。
说明:{D
D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjWiz.dll,由于IE的安全机制把HTML的向导页面禁止了。
照着解决办法做了一遍,啊哈,怎么还不行?
不过心里已经基本有底了, JeffAbraham中讲的是IE7,而我的还是IE6啊,会不会是偶用FireFox的原因?把默认浏览器改成该死的IE(并启用IE选项中的脚本调试,否则还是老样子),再次创建项目,出现JS错误,如下图:
只能调试了,common.js 4039行附近的代码如下:
1 /******************************************************************************
2 Description: When constructing a class name based on project or other user input,
3 Warn user (MessageBox) if the generated class name is a reserved name, and
4 add one digit to the name to avoid the reserved name.
5 Ex: User names the project "Atl" --> C+Atl+Module is a reserved name -->
6 Warning MessageBox plus generated name is CAtl1Module.
7 strPrefix: The first part of class name (Ex: project name - Atl).
8 strPostfix: The second part of class name (Ex: Module).
9 ******************************************************************************/
10 function ConstructClassName(strPrefix, strPostfix)
11 {
12 var strCandidate;
13 strCandidate = "C" + strPrefix + strPostfix;
14 for(var i = 1; i<=10; i++)
15 {
16 var bValid = (window.external.dte.VCLanguageManager.ValidateIdentifier(strCandidate) &&
17 !window.external.dte.VCLanguageManager.IsReservedName(strCandidate));
18 if(!bValid)
19 window.external.ReportError();
20 else
21 break;
22 strCandidate = "C" + strPrefix + i.toString() + strPostfix;
23 }
24 return strCandidate;
25 }
26
原来window.external.dte对象为空,这又是什么原因呢?
修改IE的管理加载项,竟然发现所有加载项被禁用,并且无法启用,RadioButton都是灰色的(费了好几个小时找原因,原以为是我用了TotalCommander中的注册表优化功能引起的,后来证明不是)。原来,很久很久以前,我装完机器之后设置了组策略-“除非在加载项列表中特别指定,拒绝所有加载项“(位置:组策略-用户配置-管理模板-Windows组件-Internet Explorer-安全功能-加载项管理)。修改过来,重新启动VS2005,并创建VC项目,终于看到可爱的向导了。