 |
|
 |
Ver good find
cheers,
Donsw
My Recent Article : Backup of Data files - Full and Incremental
|
|
|
|
 |
|
 |
Here is one cause I discovered: This doesn't work: // Clean up dyn mem for( int i = 0; i < pObject->numOfSomething; ++i ) { for( int j = 0; j < pObject->something[i]. ; ++j ) // <-- Intellisense bug SAFE_FREE( pObject->something[i].somethingElse[j] ); SAFE_FREE( pObject->something[i] ); } It doesn't give me anything if I type pObject->something[i]. <-- this should give me some stuff, like pObject->something[i].numberOfSomethingElse
But if is use brackets around the second loop it works just fine: // Clean up dyn mem for( int i = 0; i < pObject->numOfSomething; ++i ) { for( int j = 0; j < pObject->something[i].numberOfSomethingElse ; ++j ) { // <-- Intellisense OK SAFE_FREE( pObject->something[i].somethingElse[j] ); } SAFE_FREE( pObject->something[i] ); }
If someone wonder about the macros I use here they are: // Hardcoded breakpoint #ifndef BREAK #define BREAK __asm{ int 3 } #endif //Helpers #if defined( _DEBUG ) || defined( DEBUG ) #define PRINT(s) { TCHAR szOut[1024]; StringCchPrintf(szOut, 1024, "\n%s(%d) : %s() \t<===>\t %s\n\n", __FILE__, __LINE__, __FUNCTION__, s); OutputDebugString(szOut); } #else #define PRINT(s) #endif #ifndef STOP_TO_SHOW #if defined( _DEBUG ) || defined( DEBUG ) #define STOP_TO_SHOW BREAK #else #define STOP_TO_SHOW #endif #endif #ifndef SAFE_FREE #define SAFE_FREE(p) { try { if(p) { free(p); (p) = 0; } }catch(...) { CString target = #p; char chOut[256]; StringCchPrintf( chOut, 256, "SAFE_FREE( %s ) FAILED!", target ); PRINT(chOut); STOP_TO_SHOW; } } #endif Don't know if this is something new.. hope it helps to those that didn't know..
|
|
|
|
 |
|
 |
It seems that there are plenty of things that can trip up IntelliSense. This line caused me grief in VS.NET 2003:
#define size(t,s) ((t)sizeof(s))
Changing "size" to anything else (eg tsize, ize, etc.) fixes it.
--
Synetech
|
|
|
|
 |
|
 |
There is a sever bug in VS.IDE 2003 which is removed in 2005 version.
if you use a switch statement on long or ulong value and either MaxValue or MaxValue-1 with zero exists, the compiler will not see both values:
bool IsOk( long n )
{
switch( n )
{
case long.MaxValue:
case 0:
return true;
default:
return false;
}
}
by invoking two following statements, this function always returns false:
IsOk( 0 );
IsOk( long.MaxValue );
same problem exists using ulong values.
----------------------------------
When browsing an object in QuickWatch window, pay attention to the properties which modifies
fields in objects:
example:
class CTest
{
private int n;
public int N1{ get{ return ++n; } }
public int N2{ get{ return ++n; } }
public int N3{ get{ return ++n; } }
}
after browsing an instance of this class:
n = 0
N1 = a random number (for example 7)
N2 = a random number (for example 15)
N2 = another number (for example 23)
this bug is slightly fixed in VS.IDE 2005 but already N1,N2,N3 values contains 1,2,3
and in case of reevaluating the object, n will be a great number in VS.2003 and 3 in VS.2005.
same problem exists in Delphi 2005 (like VS.2005).
The main problem in .NET IDE is (as i guess) state of object must be saved at start phase of
quick watch for evaluating each phase and must be restored afterward. but it's contents will never be saved and restored.
reza
|
|
|
|
 |
|
 |
Just tested this switch bug that was mentioned in both VS 2003 and 2005 (.Net 1.1 without the SP and .Net 2.0) and it seems to work fine in both. Both calls to the function are returning True. ???
MI
|
|
|
|
 |
|
 |
It's a shame to still encounter this bug in the last version!
PS : I use MC++.
|
|
|
|
 |
|
 |
is if there is even on extra whitespace character at the very end of the projects licenses.licx file. Wierd but true!
Open it, remove the last blank line and any other whitespace and intellisense will magically start working again until the next 3rd party component added causes this file to be changed.
"If there is a God, atheism must seem to Him as less of an insult than religion." - Edmond de Goncourt
|
|
|
|
 |
|
 |
I have discovered the following using VC++ 6.0:
Problem:
//Intellisense works here
int HCXMLCommand1::AddRecords (uint64 tableID, std::list<int> recordIDList)
{
// Intellisense no longer works.
}
Workaround:
//Intellisense works here
typedef std::list<int> IDList;
int HCXMLCommand1::AddRecords (uint64 tableID, IDList& recordIDList)
{
//Intellisense works
}
Remarks:
It seems to be the "std::" that brings intellisense out of line.
Hope it helps someone
|
|
|
|
 |
|
 |
I have discovered the following using VC++ 6.0:
Problem:
//Intellisense works here
int HCXMLCommand1::AddRecords (uint64 tableID, std::list recordIDList)
{
// Intellisense no longer works.
}
Workaround:
//Intellisense works here
typedef std::list IDList;
int HCXMLCommand1::AddRecords (uint64 tableID, IDList& recordIDList)
{
//Intellisense works
}
Remarks:
It seems to be the "std::" that brings intellisense out of line.
Hope it helps someone
|
|
|
|
 |
|
 |
Thanks for the article Tom. At one stage I thought I was the only one having this problem. I did a re-install of VS.Net thinking perhaps that something might have gone wrong with my VS.NET 2003 update. Of course, the problem still continues.
MS states in VS.Net that intellisense may become unavailable in some situations including:
There are certain cases when the IntelliSense options may not work as you expect.
There is a code error above the cursor
If there is an incomplete function or other coding error above the location of the insertion point, IntelliSense may be unable to parse the code elements and therefore will not work. You can comment out the applicable code to enable IntelliSense again.
However I've noticed that when Intellisense fails, even when you fix your code while editing it still doesn't come back. The symptoms are the same as Tom explained: all the colored fonts disappear, no autolist and so forth. Worst still, try to do a copy and paste and the IDE comes back with the crude message: VS IDE: Copy/Paste error. If you had done a cut/paste you might as well kiss goodbye to what you had put in the clipboard. The IDE becomes unable to perform any Undo/Redo. Yesterday, I kept working while the intellisense was gone, and got the message saying I had to save my work and exit the VS IDE :-Dbecause a memory corruption had occurred!
I've been coding in both C# and VB.net and noticed that this behaviour only happens with C#, and not with VB.
The only way I've known to restore the IDE and get Intellisense back on track is by switching between the code screen and design screen, if you're working on a form.
I've no doubt MS will fix the problem. However I find a bit disappointing that a tool like VS.Net being touted as a high-level productivity tool can make us waste precious programming time trying to cope with problems like that.
Having said all that, overall I am very satisfied with MS efforts in making VS.Net a reality and believe the solution of the problem will come soon.
|
|
|
|
 |
|
 |
This is mostly unrelated to the intellisense problem(s) discussed here, but perhaps some of you have faced this before.
My problem is in providing custom intellisense support to a web service consumer through using the self-documenting XML feature of VS.NET (for C# and J#). This works fine when compiling and then referencing a documented DLL with an XML file of the same name; however there’s no DLL in the case of a web service only an ASMX file to reference, with a WSDL downloaded on the client-side. VS.NET does depend on this WSDL file to provide its intellisense of any web service (listing members for a certain type, etc…), yet I’m not being able provide my own descriptions and remarks as well.
I’d be more than grateful for any help on this issue.
Thanks,
L.
|
|
|
|
 |
|
 |
I've seen this bug before too, but it was in VC++ 6 and not in the .NET version. It's very annoying!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
 |
|
 |
This article should have come in the Bugs and Workarounds section and not in the .NET section.
You might want to move it there, to save the editors some time.
Nish
I am the Keyboard Smasher
|
|
|
|
 |
|
 |
I am using the Article Submission Wizard and the "Modify this Article" tools and do not see any "Bugs and Workarounds" section. The closes match I found was .NET.
If anyone knows what I am missing, please let me know in explicit detail.
Boy. How ya gonna keep 'em down on the farm once they seen Karl Hungus.
<p style="text-align: right; margin: 0px;">- The Dude :cool:</p>
|
|
|
|
 |
|
 |
Hello Tom
I guess you are right. I remember Chris saying that the Bugs and Workaround section will not be a section in the submission wizard.
Nish
Has anyone seen my sig?
|
|
|
|
 |
|
 |
Get Visual Assist by WholeTomato.com and you won't have these problems any longer.
|
|
|
|
 |
|
|
 |
|
 |
Grab visual assist and forget that crap if you cherish your time. Funny we have to wait for 3 years for this.
They are beta testing VS.NET, but I do not have VS.NET yet and cannot say much, in VS 6.0, it is a great time saver.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan.
|
|
|
|
 |
|
 |
I decided to try the beta of Visual Assist for .NET and it appears to be pretty stable. It does not have the problems that the built-in IntelliSense displays.
Also, there is another solution to the problem I presented.
While this line messes up Intellisense:
Point destPoints[] = {Point(200, 20), Point(110, 100), Point(250, 60)};
This one does not:
Point[] destPoints = {Point(200, 20), Point(110, 100), Point(250, 60)};
|
|
|
|
 |
|
 |
Theres another better solution:
Point destPoints[] = {Point(200, 20), Point(110, 100), Point(250, 60),};
Note the extra comma at the end Point(250, 60).
|
|
|
|
 |
|
 |
Why would you use
Point destPoints[]
over
Point[] destPoints
anyway?
I mean destPoints is a Point Array so why not declare it they way you say it?
I'm just anal about those things I guess.
Jason Gerard
|
|
|
|
 |
|
 |
Perhaps it is my background. I came from the VB world (placing the array notation after the identifier.
Dim aPoints() As POINTL
... etc ...
And I also see the style that causes the problem a LOT... On-line, in books, and in magazines. This is probably where I really picked it up.
I read: Point destPoints[]
As: destPoints is an array of type Point
It just seems natural. Anyway, I am making an effort to write it the other way in the future. Thanks for pointing this out.
Boy. How ya gonna keep 'em down on the farm once they seen Karl Hungus.
- The Dude
|
|
|
|
 |
|
 |
I agree, it should be Point[] destPoints... and I also come from a VB background.
This brings up a really important issue, one that made me avoid C++ for so long. Common syntactical style. Too many ways to write the same thing, and it's done differently every time. If you look at C++ programs from the same programmer you will see stuff like this:
byte* blah;
byte * blahblah;
byte *blahblahblah;
They all mean the same thing but it gets confusing when you are trying to read it. So if everyone will please write code the way I want them to I would greatly appreciate it. Thank you.
"Faith is believing in something you know isn't true."
- Arthur C. Clark
|
|
|
|
 |
|
 |
Just to get you more confused:
The following mean the same thing:
const char *
char const *
While those don't:
char const *
char * const
Regards,
Victor
phpWebNotes is a page annotation system modelled after php.net.
http://webnotes.sourceforge.net/demo.php[^]
|
|
|
|
 |
|
 |
Hey - my $0.01 is that while its been awhile, I actually miss C++ (stuck using VB.NET) but this used to just annoy me: I was never great at C. I may be wrong but is...
const char * var
an 8bit pointer to a constant value
while
char* const
is assigned when declared, and always points to the same memory address? =
D'Whizz!
. . . . . <--=_~.|-|./^\.\/.~_=--> . . . . .
*******************************************
|
|
|
|
 |