visual-studio-2010

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

自闭症网瘾萝莉.ら 提交于 2020-01-08 13:26:49
问题 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 :

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

荒凉一梦 提交于 2020-01-08 13:26:47
问题 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 :

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

[亡魂溺海] 提交于 2020-01-08 13:26:45
问题 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 :

multitouch in WPF Not working

流过昼夜 提交于 2020-01-07 09:34:20
问题 I'm new to multi touch programming. im using windows7, VS-2010 and WPF to develop.I follow the tutorial in this link: http://surfacedeveloper.blogspot.in/2009/10/multi-touch-in-wpf-40-and-vs2010.html here i don't have the property ManipulationMode="All" . I don't know what I'm doing wrong. please help me!!! 回答1: ManipulationMode seemed to be a UIElement property in .NET 4.0 beta 1. I guess it was what now is IsManipulationEnabled. 来源: https://stackoverflow.com/questions/11931748/multitouch-in

Replace Thread.Sleep with System.Threading.Timer?

戏子无情 提交于 2020-01-07 08:30:13
问题 I'm trying to replace Thread.Sleep with System.Threading.Timer, and I'm trying to implement it in the following code. The main reason for changing is that, even though it works when testing locally, it's not working properly in the server. Plus, I've read that using it here is bad practice. I've seen several examples (including the one below), but I'm not certain how I could use it in my case: System.Threading.Timer in C# it seems to be not working. It runs very fast every 3 second In my

How to programmatically discover whether the running application is installed? [closed]

此生再无相见时 提交于 2020-01-07 08:09:21
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want the program to check if it's installed on the computer (using Clickonce) or just being run (e.g. by Visual Studio). EDIT: Not a duplicate of How to detect that C# Windows Forms code is executed within

Command Line Arguments and File Input

社会主义新天地 提交于 2020-01-07 06:37:21
问题 I had a terrible time with file input from command line arguments last semester and I need to utilize it for an exercise that I am working on. I have coded a simple shell just to get it working: prob_5.c #include <stdio.h> int main(int argc, char *argv[]) { int i; FILE *fp; int c; for (i = 1; i < argc; i++) { fp = fopen(argv[i], "r"); if (fp == NULL) { fprint(stderr, "cat: can't open %s\n", argv[i]); continue; } while ((c = getc(fp)) != EOF) { putchar(c); } fclose(fp); } return 0; } I can't

Getting IClassifier to work with custom content type

南楼画角 提交于 2020-01-07 05:46:08
问题 I am trying to add syntax highlighting for a custom content type based on text e.g. static class RTextContentType { public const string ContentTypeName = Constants.CONTENT_TYPE; [Export, Name(ContentTypeName), BaseDefinition("text")] internal static ContentTypeDefinition ContentTypeDefinition = null; // set via MEF } Then the classifier provider is declared like this, [Export(typeof(IClassifierProvider)), ContentType(Constants.CONTENT_TYPE)] class RTextClassifierProvider : IClassifierProvider

Dead items in context menu left by addin in Visual Studio

一曲冷凌霜 提交于 2020-01-07 04:36:13
问题 We are developing addin for Visual Studio. It creates items in Solution Explorer context menu. The problem is when we remove the addin, menu item is still there but without icon. When I click on it, VS propose to remove the command. See screenshot. How should they be uninstalled to remove the command? At the moment I just remove the addin file from "Visual Studio 2012\Addins" folder during uninstall. I'm using class Connect : IDTExtensibility2 回答1: One option is to run a .vbs script on

Codebehind file doesn't recognize aspx-controls

允我心安 提交于 2020-01-07 04:22:28
问题 I was given a webproject written with aspx/c#. When I loaded it into Visual Studio 2010, I got many error telling me that some controls in the code-behind files do not exist in the current context. I checked for the common pitfalls, like wrong code-behind file name, missing runat -attribute, restart VS, reload project, yet nothing resolves the error. What else can I do to check where the problem is? 回答1: Try to change the code-behinde to CodeFile="where code locate", then it probably will