visual-studio-2010

Command vs. Immediate Window in Visual Studio

﹥>﹥吖頭↗ 提交于 2020-01-09 19:17:45
问题 The Command Window and the Immediate Window seem to do very similar things (for example, I can display variables in both windows by typing ? myVariable ). What are the differences and why does Visual Studio include both? 回答1: They do different things. Immediate window: The Immediate window is used at design time to debug and evaluate expressions, execute statements, print variable values, and so forth. It allows you to enter expressions to be evaluated or executed by the development language

Is it possible to install two different versions of Visual Studio in the same computer? [duplicate]

拥有回忆 提交于 2020-01-09 18:20:58
问题 This question already has answers here : Can I install two different versions of Visual Studio on the same computer? (3 answers) Closed 3 years ago . Is it possible? or there is a compatibility issues between the two versions? Because our company is using an outdated version of visual studio (VS2005) and I wanted to try out Visual Studio 2010/2012/2013 for the purpose of learning while there is no project to do. (any of the three newer version is fine) but I don't know if it'll affect the

Visual Studio Version Selector Doesn't open

一世执手 提交于 2020-01-09 12:39:31
问题 I have Visual Studio 2008 and 2010 installed side by side, but trying to open either a 2008 or 2010 sln file results in nothing. The hour glass comes on for about a second and then it goes away and nothing is opened. I read somewhere to relate sln file to VS directly, but I can't go that route because I don't want 2008 solutions to open with 2010. Does anyone know what the problem might be and how to fix it? 回答1: If you are running Vista or Windows 7 with the UAC enabled and have "Run this

Why is DragDrop not working under VS2010?

依然范特西╮ 提交于 2020-01-09 11:09:39
问题 I have a winforms app that uses a UserControl. The user control's job is to collect a file that the user drops on it from Windows Explorer, Open the file, determine the type and handle it accordingly. This control worked PERFECTLY under Visual Studio 2008 Pro. I upgraded to VS 2010 Pro, and now, it doesn't work. Is there a flag or a property that has changed that I should be aware of?? I made a quick demo to test. This demo works perfectly under 2008, but doesn't work at all under 2010. The

How to insert a duplicate element into a vector?

…衆ロ難τιáo~ 提交于 2020-01-09 11:06:49
问题 I'm trying to insert a copy of an existing vector element to double it up. The following code worked in previous versions but fails in Visual Studio 2010. #include <iostream> #include <vector> using namespace std; int main(int argc, char* argv[]) { vector<int> test; test.push_back(1); test.push_back(2); test.insert(test.begin(), test[0]); cout << test[0] << " " << test[1] << " " << test[2] << endl; return 0; } Output is -17891602 1 2 , expected 1 1 2 . I've figured out why it's happening -

Attribute argument must be a constant error when using an optional parameter in the attribute constructor

孤街醉人 提交于 2020-01-09 10:37:27
问题 Can anyone explain why this code works: public class AdministratorSettingValidationAttribute : Attribute { public AdministratorSettingValidationAttribute(AdministratorSettingDataType administratorSettingDataType) { DataType = administratorSettingDataType; } public AdministratorSettingValidationAttribute(AdministratorSettingDataType administratorSettingDataType, Type enumerationType) { DataType = administratorSettingDataType; EnumerationType = enumerationType; } } ...but refactoring it to use

How do I use Powershell to add/remove references to a csproj?

烂漫一生 提交于 2020-01-09 07:18:04
问题 In relation to this previous question I am trying to create a batch file which as part must remove and add a reference to an XML *.csproj file. I have looked at this, this, this and this previous question but as a powershell n00b am unable to get it working (so far). Can anyone help me with the following? I want to remove two specific references in a VS2010 csproj file (XML) and add a new reference. I opened the csproj and the reference can be found at the following location <?xml version="1

How to capture mouse wheel on panel?

旧街凉风 提交于 2020-01-09 03:44:45
问题 How to capture mouse wheel on panel in C#? I'm using WinForms EDIT: I try to do it on PictureBox now. My code: this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick); this.pictureBox1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick); private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { MessageBox.Show("Click"); } Clicking works. Wheelling doesn't. Why? 回答1: Windows sends the WM_MOUSEWHEEL

Can Visual Studio 2012 be installed side-by-side w/ Visual Studio 2010?

女生的网名这么多〃 提交于 2020-01-09 01:52:50
问题 Will Visual Studio 2012 interfere/break .NET 4 and/or Visual Studio 2010 if installed side-by-side on the same instance of Windows? 回答1: As Reigo said, yes. Here's the link to the official Microsoft page with the information Reigo provided, and more details: http://msdn.microsoft.com/en-us/library/ms246609%28v=VS.110%29.aspx 回答2: The .net 4.5 release is an In-place upgrade. This means that the binaries for .net 4.0 will be REPLACED by the binaries for .net 4.5 . Microsoft has attempted to

One VS2010 bug ? Allowing binding non-const reference to rvalue WITHOUT EVEN a warning?

时光总嘲笑我的痴心妄想 提交于 2020-01-08 13:27:30
问题 string foo() { return "hello"; } int main() { //below should be illegal for binding a non-const (lvalue) reference to a rvalue string& tem = foo(); //below should be the correct one as only const reference can be bind to rvalue(most important const) const string& constTem = foo(); } GCC is the good one to give a compile error : invalid initialization of non-const reference of type std::string& from a temporary of type std::string VS2008 is not too bad as at least it gives a compile warning :