注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
黑衣人的个人空间 https://home.eeworld.com.cn/space-uid-43044.html [收藏] [复制] [分享] [RSS]
日志

Visual Studio 无法创建应用程序

已有 3588 次阅读2008-5-15 13:41

问题:在Visual Studio 20005 中创建新项目,选择一个VC++的智能设备项目,都会在状态栏显示“正在创建项目‘XXX’,创建项目失败”。解决办法如下:

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在作怪,找把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项目,终于看到可爱的向导了。

 

    题外话:在VS无法正常使用的空间,我的IE也出问题了,打开IE有些网页出现无法加载,

a.用IE优化修复,无济于事;

b.在运行命令中输入cmd 回车,然后输入 :                   

 for %1 in (%windir%\system32\*.dll) do regsvr32.exe /s %1  好像还是不行 

c.直接打开IE,在工具--管理加载项中禁用报错的加载项,IE可以正常打开了,但IE有些内容无法正常阅读.

d.Visual Studio中又出现新错误,控件无法添加变量,遂死心,卸载IE7,重装IE6,这下才一切正常.

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章