Intellisense problem with VS 2005 solved?

Hi all,
I've been having problems with intellisense autocompletion eversince I switched from VC6 to VS2005. It seems that on some of my classes the scope wasn't found by Intellisense (although code compiles and behaves perfectly well).
After a little tinkering around, removing .ncb file, rebuilding again and again, dancing around the computer hoping for some magical change of behavior from Intellisense I was still
left alone without my loved autocompletion. So I searched around the web, tried the different solutions proposed but to no avail.
Yet I've finally found a way to make it work on my computer. The header file where some of the classes were defined was using the following syntax to avoid multiple include problems
#ifndef _MY_CLASSES_
#define _MY_CLASSES_

// my classes here...

#endif
It turned out that by replacing this portion of code by a simple #pragma once statement and recompiling everything Intellisense started working correctly. Happy as I was I just went to my co-workers and tried the same workaround on their compiler (VS 2005 express) hoping it would work. Alas it seems only I was lucky enough for this workaround to work.
So after this long post my questions is basically, am I very lucky and should start considering gambling some of my hard earned cash Is it something to do with VS2005 pro being better than its express sibling or is it finally the result of my dancing around the computer which finally paid off

Sebastien


Answer this question

Intellisense problem with VS 2005 solved?

  • Viper32

    I've found one :-)
    Meanwhile it is a bit tricky to extract :-(

    It comes from the wxWidgets libraries (wxWidgets.org) - v2.6.2. It is a bit complex to explain how to use it here. But if you manage to compile it (probably you don't need it as Intellisense will parse the file without requires compilation):
    -in the file include/wx/dataobj.h line 264 it looks like:


    WX_DECLARE_EXPORTED_LIST(wxDataObjectSimple, wxSimpleDataObjectList);

    class WXDLLEXPORT wxDataObjectComposite : public wxDataObject
    ...

    The WX_DECLARE_... is a huge macro (in fact several embedded) in charge of defining the class wxSimpleDataObjectList. The compiler parses it successfuly - so it seems correct. But when I point the word wxDataObjectComposite below the popup reads: "class wxSimpleDataObjectList::wxDataObjectComposite" which is stupid as wxSimpleDataObjectList is not a namespace nor and embedded class. At least if I point on the next word "wxDataObject" the popup reads correctly "class wxDataObject".

    -Now in our code, some classes are not detected by Intellisense. I could not find why ones could and ones could not. But I have notice the following (suppose the class Foo is not detected):
    -on pointing on "void Foo::f()" (more precisely on "Foo") then the popups read "void Foo" which is erroneous!
    -And better, when right-click on a "Foo" and asking for "Go to definition" I am being proposed with Foo::Foo the ctor in Foo.cpp which is not what I wanted, and wxSimpleDataObjectList::Foo in Foo.h which is the one I wanted but what is this damned wxSimple... here!

    Thus I believe this macro totally scrambled intellisense with strange consequences.

    Hope this helps... the new intellisense seems to be quite useful... when it works.

    Sylvain

    PS: wxWidgets is a great library and not responsible for disturbing VC2005. At least it provides a concrete example :-)

    PS: now get prepare for reading the macro. You also need to known that the config is wxUSE_STL=0 (the default).



  • Guido Draheim

    That is exactly the problem. If you can log the issue at http://lab.msdn.microsoft.com/productfeedback/default.aspx with a sample reproducing the problem I will be more than happy to follow up personaly on it and make sure the owners take a look.

    We really want to get all those hidden problems flushed out and fixed.

    Thanks for advance for taking the time to log the issue.

    Thanks,

    Ayman Shoukry
    Program Manager
    VC++ Team


  • qifeng

    I don't think so - if it didn't work on all machines then you're out of luck.

    In my opinion, the only possible way we could see any of these Intellisense problems being addressed in SP1 (6 months away) is if some people that have these problems start to work with Microsoft directly. This would involve sending code (that may be confidential) to Microsoft, so they can look at it, and seeing where their failure points are occurring.

    My hunch is that none of these problems are reproducible at Microsoft.


  • Intellisense problem with VS 2005 solved?