All,
I have a strange issue with Intellisense for C++ projects. Background: I have recently installed VS2010 Sp1 and had a loss of Intellisense with SQL Server 2008 R2. I tried installing Cumulative Update 7 (CU7) as recommended and this did not work. Reinstalling SQL Server 2008 R2 however, did. I then updated using CU7 for SQL Server 2008 R2 and all was good. Now Intellisense works fine for C# projects but now for C++ projects it is not quite working as it should (NOTE: C++ project is not C++/CLI).
I have disabled Precompiled Header (“Not Using Precompiled Headers”) and have the following includes:
#include <cmath>
#include <complex>
#include <iostream>
#include "stdafx.h"
#include "globals.h"
using namespace std;
NOTE: I am aware that using the std namespace is not always considered best practise, but here it will save me allot of time and there is no chance of ambiguity.
So now when I want a printf statement for example, if I type printf I get not Intellisense prompt. However, if I Ctrl+Space or Ctrl+J Intellisense is recognising the command, and it shows up. Below is the image of Intellisense not automatically working.

Now if I type std::printf, Intellisense appears:

Is there any way to let VS2010/Intellisense know I want to use the std namespace because it appears like it is just not recognising the “#using namespace std;” command.
Thanks very much.
Note: My second answer. Based on a comment by Cory Nelson, so I don’t claim credit.
If I understand you correctly, you want that Intellisense pops up the moment you type ‘p’.
The answer is: No, VS2010 won’t do that.
Intellisense will kick in for “::p” or “std::p”, but not for a plain “p”. This has nothing to do with precompiled headers, nor
#includeorder. It just won’t.Some of the IDEs I’ve worked with in the past have a setting to enable/disable completion in this case (I recall seeing so in some C++ Builder version), but I couldn’t find it in VS2010.
So why would VS2010 not allow it? Keywords could cause problems that are not worth solving, but whether that’s the reason here? I don’t know. Maybe a member of the VS team could shed some light on this.
Update:
I tested this program in a new VS2010 project:
No popup while typing “stri”.
“string” appears in the pop-up after ctrl-space, and is absent when I remove the
using namespace std;so it correctly reacts to theusing.After typing
::, Intellisense activates and after::ssuggests SA_AccessType (from the file sourceannotations.h), so the list is clearly prepopulated with many system headers.If I type
ifand force Intellisense to pop-up, there is noifin the list. If I then type the(as if I wanted to typeif(, it corrects toifstream(. So if Intellisense would always pop-up, it would be much harder to type keywords.