Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

Very big bug in .NET and Intellisense (VC++)!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Giuseppe - 22 Jun 2004 07:45 GMT
Hello,

Try these lines of code, after create a new Win32 project, in a cpp module you choose.
Define a macro and two struct like this:

#define    ParmEq(a,b)    (fabs((double)(a-b)) <= 0.00001)

struct t_point
{
    double    x;
    double    y;
}
struct t_box
{
    t_point    min;
    t_point    max;
};

Then in a body function write:

t_box    box;

If( ParmEq( 10, box.min.x ) )

When you write the dot after "box", Intellisense display correctly the min/max members of the struct; when you write the dot after min, Intellisense don't display anything, write the "x" and when you press the space, VS stop responding for about 30 seconds.
Now open Task Manager, go to Performance page and look at PF usage: mine arrive to 1.66 GB (!!!), starting about at 200MB. If I close VS, all returns to original state.
But the very strange thing is that if you change the member names of t_box struct (e.g. minimum,maximum) all seems OK!

This behaviour occurs in all developing computers of our dept.; whe have Windows XP with SP1, VS .NET 2003 version 7.1.3088, .NET Framework version 1.1.4322 with Visual Basic/Visual C++/Visual C#. All computers have 1GB RAM.

Can someone explain where am I wrong or if it's a bug?

Thanks everybody,
Giuseppe Paoletti
Stephen Bye - 22 Jun 2004 11:10 GMT
Possibly because yours are not the only definitions of "min" and "max".

> Hello,
>
[quoted text clipped - 21 lines]
>
> When you write the dot after "box", Intellisense display correctly the min/max members of the struct; when you write the dot after min,
Intellisense don't display anything, write the "x" and when you press the
space, VS stop responding for about 30 seconds.
> Now open Task Manager, go to Performance page and look at PF usage: mine arrive to 1.66 GB (!!!), starting about at 200MB. If I close VS, all returns
to original state.
> But the very strange thing is that if you change the member names of t_box struct (e.g. minimum,maximum) all seems OK!
>
> This behaviour occurs in all developing computers of our dept.; whe have Windows XP with SP1, VS .NET 2003 version 7.1.3088, .NET Framework version
1.1.4322 with Visual Basic/Visual C++/Visual C#. All computers have 1GB RAM.

> Can someone explain where am I wrong or if it's a bug?
>
> Thanks everybody,
> Giuseppe Paoletti
Giuseppe - 22 Jun 2004 11:25 GMT
> Possibly because yours are not the only definitions of "min" and "max".

Maybe, but they are obviously related to the struct definitions, not to the min/max macro.
Otherwise, if you change the macro ParmEq into a function, everything is fine.
Thanks for reply.
Tarek Madkour [MSFT] - 23 Jun 2004 19:31 GMT
> Maybe, but they are obviously related to the struct definitions, not
> to the min/max macro. Otherwise, if you change the macro ParmEq into a
> function, everything is fine. Thanks for reply.

In VS2002/2003, IntelliSense did not parse macros correctly all the time.
That's why you're seeing this bug.

We fixed this in VS2005 (currently pre-Beta) along with correctly parsing
namespaces, templates and tracking macro state.

Thanks,
Signature

Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.