Visual Studio 2005“正在创建项目‘XXX’,创建项目失败”

在打开一些 VC++ sample 时没有问题,但是自己着手创建任何VC++的项目时,出现以下问题:在输入工程名、设置路径后 ,都会在状态栏显示 正在创建项目 ‘XXX’ ,创建项目失败 。耽搁了好几天,一直没能解决,无法找到错误日志,也想不明白啥原因, 于是昨天花了近一小时去卸载与重装VS2005(机器烂了点没办法 ^_^),问题仍然没解决....

 

于是搜索了一下相关文档,看来今天运气不错,用半调子英文把错误信息转成 " 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

{D245F352-3F45-4516-B1E6-04608DA126CC}

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 8在作怪,找把 IE 抛弃了,它还是来坑人,烦的狠啊。

说明: {D245F352-3F45-4516-B1E6-04608DA126CC} 指的是

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 项目,终于看到可爱的向导了......

 

(实在搞不定,你最好把IE8卸载了吧!我觉得Firefox很不错!)

 

本文转自:http://www.cnblogs.com/lvseganlan/articles/968285.html

你可能感兴趣的:(C,VC/MFC)