转到正文

存档

分类: Visual Studio

When you use Visual Studio on Windows 7 or Vista, you encounter "access denied. Please make sure you're running the application as administrator" error if you want to do some administrator's tasks.

There are two solutions:

  • turn off the UAC of your Operating System
  • run visual studio as administrator.
    There is good trick for runing VS always as Administrator[1].

Reference:

[1]. http://weblogs.asp.net/soever/archive/2009/10/07/visual-studio-alway-run-as-administrator.aspx

There are some changes between Visual Studio 2008 and 2010, if you want to upgrade your program to an advanced one ( transfer 2008 to 2010), you can follow some steps:

  1. upgrade VS2010 wizard instructions.
  2. because vs2010 remove the global VC++ directories, visaul studio team use Property sheet to take place of it. So you can create some property sheets and set the directories ( for example: DirectX folders) for them, and take your project to reference them ( m projects shared n property sheets, m>=n).
  3. set up project dependency  for the solution, and then visual studio will do project order automatically for the solution
  4. build the project or solution, and then vs will build the projects in order.

Good luck!

Reference:

[1]. http://www.liaoqiqi.com/blog/2010/05/04/visual-studio-2010-vc-directories/

Good article for new feature "VC++ Directories" of Visual Studio 2010!

Reference:

[1]. http://blogs.msdn.com/vsproject/archive/2009/07/07/vc-directories.aspx
[2]. http://blogs.msdn.com/vsproject/archive/2009/06/23/inherited-properties-and-property-sheets.aspx

A document split into 4 sections

There are two ways to split the current window:

  • From the Menu Bar, go to Window - Split.
  • Using the mouse, grab the splitter control found directly above the document scrollbar

Document Splitter Control Location

But the split command only works horizontally.  If you need to split vertically (see Program.cs:2 in the above picture), try using the Window.NewWindow command found on the Menu Bar at Window - New Window. Then, as in the picture above, go to Window - New Vertical Tab Group.

Reference:

[1]. http://blogs.msdn.com/saraford/archive/2007/07/31/did-you-know-how-to-split-windows-and-create-new-windows.aspx

Today I met this problem when I want to add a existed DB into my Visual Studio 2008 server. This error can be solved by follow the Microsoft Studio Team's instruction[1]. Ijust follow the first one and I solved it! That's :

a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

Good Luck!

Reference:

[1]. http://social.msdn.microsoft.com/Forums/en-SG/vssetup/thread/c59cdca4-bad6-481c-85af-69c149b6f1aa

C/C++ code使用尖括号的话,编译时会先在系统include目录里搜索,如果找不到才会在源代码所在目录搜索;使用双引号则相反,会先在源代码目录里搜索。这就意味着,当系统里(如/usr/include/里)有一个叫做math.h的头文件,而你的源代码目录里也有一个你自己写的math.h头文件,那么使用尖括号时用的就是系统里的;而使用双引号的话则会使用你自己写的那个。

所以建议: 使用系统里提供的头文件时使用尖括号 使用自己编写的头文件时使用双引号。

Linux环境下的C++头文件搜索路径方式就是按照上面的方法来的。

但是,VS2005环境与与Linux环境的设定是有点不一样的!

在VS2005环境下,我们#include <自己的头文件> 会提示:  fatal error C1083: Cannot open include file: '******.h': No such file or directory
这是因为当编译器是这样来寻找这个头文件的: 先在系统include目录下查找,发现查找不到,然后在项目的#include目录下查找,发现也查找不到(因为VS2005环境默认的项目#include目录为空). 所以就会出现错误.

我们只要将项目的头文件搜索路径加入 "." (当前路径) 那么,就可以编译成功了.

20090926

继续阅读

www.liaoqiqi.com网站PR查询 博客简洁版 博客Google_Site_Map 博客Baidu_Site_Map ?