Visual studio C++ IntelliSense issue - visual-studio-2010

I seem to be having two issues with my project after I converted from VS 2005 to VS 2010.
IntelliSense: command-line error: invalid macro definition:
_WIN32_WINNT>=0x0501
And I also cant seem to be able to do a "Call Hierarchy" on any of the methods or properties.
I would appreciate if someone can help me with these. Thanks

I just encountered the same issue - the same error message, the same non-functioning call hierarchy and badly-working Intellisense.
The problem was with the preprocessor flags in the project, the following were defined:
WIN32;_DEBUG;WINVER=0x501;_WIN32_WINNT 0x0501
Notice the lack of = after _WIN32_WINNT. Adding the = fixed all the issues.
P.S., this is a Console application that doesn't use any of the Windows header files, which is why the lack of the _WIN32_WINNT macro did not cause a more severe problem.

Decided to ignore the intellisense warnings. The call hierarchy wasn't working because I was in the release mode. Should be in debug mode.

Related

Visual Studio "Organize Usings | Remove and Sort" falsely reports error

In various code files of various projects, Visual Studio sometimes gives an error message when I tell it to remove and sort the usings of the code file. The message:
"Your project or one of its references does not currently build. If you
continue with this operation, required usings may be removed."
However, this is not true. Required usings are not removed when telling VS to continue, and the project does build.
I have Googled this issue, looked in MSDN, and tried to figure out why I get this on certain code files but not others, but no no avail.
Has anyone else encountered this, and if so, any ideas what this is about?
Ps. I am running VS 2012 Ultimate, but I saw this from at least 2005.
This error message can come up erroneously, and is a known issue documented out on Microsoft Connect:
http://connect.microsoft.com/VisualStudio/feedback/details/785457/remove-unused-usings-falsely-reports-that-project-does-not-build-for-certain-files
It will not be fixed with the current MSBuild compiler, but will be fixed with Roslyn.
Workaround:
You can disable the warning message by going to Tools->Options->Text
Editor->C#->Advanced->"Warn if build errors exist when organizing
usings".
Keep in mind this has the downside that it won't protect you any more
if your solution really does not build.
I had this same issue and it turned out there was an invalidly formatted class reference in an XML comment. I had something like this
<see cref="List{T">
Note the missing '}' character at the end. It was driving me crazy until I found that.
Note: I'm using Visual Studio 2012 with the Productivity Power Tools installed, and this was happening every time I saved because I had the "remove and sort usings on save" option turned on. I really like this feature and was on the point of turning it off due to these warnings, thinking it was buggy. Now I know what to look for when I get them.

Does compiler warnings cause intellisense to stop working?

I am using Visual Studio 2010 (c++), and Intellisense has stopped working. I've read that an error in the code can cause this, but my code compiles fine, I only have some warnings about a deprecated function, can this cause intellisense to stop working?
I tried deleting the .ncb file, but is not being regenerated. Also I read here that I have to make sure that stdafx.h is on the include path but I dont have stdafx.h on my project and I have used intellisense without it in the past.
I don't know what else I can do to try to make it work, any suggestions?
The IntelliSense parser was completely rewritten for VS2010. It no longer uses the .ncb file, it is now an .sdf file, a SQL Compact database. If you program in the C++/CLI language then you'll get no IntelliSense at all, the current implementation doesn't support that language. I've also seen feedback that C isn't well supported either yet.

How do I build Notepad++ with Visual C++ 2010 Express?

Windows SDK is installed. I built N++ successfully with Visual C++ 2008 Express before. But now with 2010 I have a lot of error messages about sprintf_s:
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\string(676): error C2039: 'sprintf_s' : is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\string(676): error C3861: 'sprintf_s': identifier not found
Please help.
There's a property sheet included with the project named no_ms_shit.props (after conversion). There's a fair amount of hate expressed in that sheet for what MS has been trying to do for the past 5 years.
They went a little too over-board with turning everything off, they even disabled linking to sprintf_s(). Which is the source of your error, the stdio.h header omits the declaration but the string header uses it. Not sure if the Express edition supports editing project property sheets, but the step in the retail edition are:
View + Property Manager
Open one of the nodes and locate "no ms shit"
Right-click it, Properties
C/C++, Preprocessor, Preprocessor Definitions
Change __STDC_WANT_SECURELIB__=0 to 1
Add _CRT_SECURE_NO_WARNINGS to those definitions
The project compiles clean now. I do get a build error for copying files, it is a post-build event. Start another question if you can't figure out how to fix it.
Strange. I have Visual Studio 2010 Ultimate, and it even doesn't allow me to access the View->Property Pages menu item. It is disabled for me.
But I just went to the file no_ms_shit.props and edited that in Notepad++ only :). Then went to Project->Properties->Configuration Properties->General, and selected 'No' for treat warnings as Errors, and added _CRT_SECURE_NO_WARNINGS in the preprocessor definitions.
Don Ho should go with the flow than cursing the ms shit when he is developing in Windows and Visual Studio.
This worked for me when using Visual Studio 2012 Professional:
You have to edit no_ms_shit.vsprops (*.vsprops, not only *.props!):
Replace __STDC_WANT_SECURE_LIB__=0 by __STDC_WANT_SECURE_LIB__=1
Add _CRT_SECURE_NO_WARNINGS to the preprocessor definitions.
A closer look at the source would show that most of the library calls that cause endless noise unless you use this property sheet come from the SciLexer.dll project. Scintilla is cross platform, so it doesn't need all the Windows specific cruft.As you mentioned, Microsoft went overboard with their replacing the standard string library, as legitimate as their attempt to avoid buffer overruns may be.
So you may direct this criticism to Neil Hodgson (main developer of Scintilla) rather than Don Ho.
CChris

int number; number.m_value?

Today my Visual studio couldn't help me by auto complete so I thought that the ReSharper trial period had ended .After I suspended ReSharper I see that still no auto complete. After a few changes I see still the same problem and there are some strange behavior in Visual Studio. For example I see m_value field for int. But my other Visual studio instances works as expected. How can I fix this problem?
Probably there is an error somewhere in your code which is causing the types to be determined incorrectly - for example a missing curly brace. Check your code carefully for errors. Make sure that your code compiles correctly.
PS: You don't need ReSharper to get autocompletion. Intellisense is a standard feature of Visual Studio. Even without ReSharper I find the built-in autocompletion extremely usable.
IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment.
The file property build action was content and this was reason of those strange behaviours. It is fixed after turned build action to compile.

How can I suppress individual BizTalk warnings in Visual Studio 2005

We are currently using BizTalk 2006 R2 to build Enterprise Integration solutions. We use BizTalk maps extensively, but when you build a solution in Visual Studio 2005, it produces the following warning against maps:
Warning Double-click here to show/hide compiler links.
In my opinion, these are not real warnings and can be ignored, but I don't like that strategy because ignoring warnings is a bad habit to get into.
Using a \nowarn property does not seem to be an option because the message does not have an associated number.
Also, when the project is built using a build script the warning disappears, suggesting that this is a feature of Visual Studio rather than a real compiler warning.
So I was wondering if there is a way to suppress this type of warning in Visual Studio.
I don't believe there's a way to suppress these for BizTalk projects. BizTalk gurus just learn to ignore them.
You can use the /nowarn option to suppress warnings.
See MSDN: /nowarn (Suppress Specified Warnings) (C# Compiler Options).

Resources