Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA replaces . by -> after CString

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
HansSch Posted - Nov 24 2015 : 02:33:00 AM
Since a couple of days, VA replaces a dot after a CString variable with an arrow. Posting system info followed by detailed description.

VA Info
=======
License: [email protected] (12-user license) Support ends 2016.08.13
VA_X.dll file version 10.9.2076.0 built 2015.09.15
DevEnv.exe version 11.0.61219.0 Premium
msenv.dll version 11.0.61030.0
Comctl32.dll version 6.10.9600.17810
Windows 8 6.2 Build 9200
4 processors (x86-64, WOW64)
Language info: 1252, 0x409

Platform: Project defined
Stable Includes:
C:\\Program Files (x86)\\Windows Kits\\8.0\\Include\\winrt;
C:\\Program Files (x86)\\Windows Kits\\8.0\\Include\\shared;
C:\\Program Files (x86)\\Windows Kits\\8.0\\Include\\um;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\atlmfc\\include;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\include;

Other Includes:

Stable Source Directories:
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\crt\\src;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\atlmfc\\src\\atl;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\atlmfc\\src\\mfc;

VS Info
=======
Microsoft Visual Studio Premium 2012
Version 11.0.61219.00 Update 5
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Premium

Office Developer Tools 04941-004-0043007-02596
Microsoft Office Developer Tools

Team Explorer for Visual Studio 2012 04941-004-0043007-02596
Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012 04941-004-0043007-02596
Microsoft Visual Basic 2012

Visual C# 2012 04941-004-0043007-02596
Microsoft Visual C# 2012

Visual C++ 2012 04941-004-0043007-02596
Microsoft Visual C++ 2012

Visual F# 2012 04941-004-0043007-02596
Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker 04941-004-0043007-02596
Microsoft� Visual Studio� 2012 Code Analysis Spell Checker

Portions of International CorrectSpell� spelling correction system � 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage� Dictionary of the English Language, Third Edition Copyright � 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

ASP.NET and Web Tools 2012.3.41009
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

NuGet Package Manager 2.6.40627.9000
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.0
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools 11.1.20627.00
Microsoft SQL Server Data Tools

Visual Assist
For more information about Visual Assist, see the Whole Tomato Software website at http://www.WholeTomato.com. Copyright (c) 1997-2015 Whole Tomato Software, Inc.

VisualSVN 4.0.12
Integration with Subversion version control. For more information about VisualSVN, see the VisualSVN website at http://www.visualsvn.com
Copyright � 2005-2015 VisualSVN Ltd. All rights reserved.

Problem Description
===================
In a C++ project with MFC, define a function, then type into the function body:
CString str;
str.
At this point, the dot behind 'str' is converted into '->' although CString has no 'operator->()'. This does not happen with other types (I explicitly tried CWnd).
The expected behavior is to leave the dot as it is.
Workaround: Type Ctrl+Z (some other keystrokes will also do) after the '->' appears. I don't like this because VA should reduce the required number of keystrokes, rather than adding to them.
11   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 27 2015 : 2:20:39 PM
In my test, alt-g is giving me 4 entries for CString.

If you go to the header file, and place the caret into the "#if 1" line and press Ctrl-], what happens? I am cycled through the #if 1, #else and #endif lines.

If you show VA Outline, are you seeing #if 1 and #else nodes, with the correct lines when you expand them? For me, the #else node shows CString and #endif when you expand it.

I am wondering if there could be something between the two typedef lines that could be a factor. My test case just uses:

#if 1
typedef char char8;
typedef const char8* CString;
#else
typedef CString CString;
#endif

so the extra lines at your end could be a factor. If Ctrl-] works, would you be able to post, or send me, the full block? Then I can test the same code here, and see if I can reproduce the problem.

If sending me the code, rather than posting it, works better, please submit the code via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.
accord Posted - Nov 27 2015 : 09:42:08 AM
Can you please try untick the following setting to see if it helps?
Convert dot to -> if operator is overloaded

It seems this vstypes.h is also confusing our parser, I'm not sure why. If unticking this setting doesn't work or it introduces other problems, we can dig deeper to see why it still fails.
HansSch Posted - Nov 27 2015 : 02:18:52 AM
Hi feline, I tried it but it didn't help. The effect is:
- When I press Alt+G on CString then VA offers me 3 locations to go, but the 'char8*' is not among them. I will try to add a screenshot to this post.
- When I type the name of a CString variable and press '.', the dot is replaced by '->'.



feline Posted - Nov 26 2015 : 5:01:28 PM
Are you able to make an edit to this SDK header file? If so, can you try changing the typedef lines to read:

#if 1
typedef char char8;
...
typedef const char8* CString;
#else
typedef CString CString;
#endif

the compiler will ignore the commented out code, but VA will parse it, and follow the second version it sees. Adding this version to a test project here, and rebuilding the VA symbol database:

VA Options -> Performance -> Rebuild symbol databases

fixed the problem for me.
HansSch Posted - Nov 26 2015 : 01:49:56 AM
Hi feline, and thank you for your reply. I found the reason for the problem, but I am not sure how to solve it.
We use a 3rd party SDK (the VST SDK by Steinberg) which defines
typedef char char8;
...
typedef const char8* CString;

This declaration is inside a namespace, but it nevertheless seems to confuse VA.
When I press Alt+G on 'CString' in my code, it takes me to the SDK header, but when I press F12, it takes me to the usual definition in afxstr.h. I assume this means that VA has a different opinion than VS about which namespaces are in effect.
This explains why I started to see the problem only recently: We started to use this SDK only a few weeks ago.
feline Posted - Nov 25 2015 : 2:29:03 PM
Thank you for your detailed investigations, this sounds like it took a fair while!

I don't think I have ever seen path length be a problem, but there is a first time for everything. If this was a problem, I would expect you to encounter different problems, symbols not being known since files were not being parsed, files not being found when you want VA to go to them.

VA does not know or care about source control, only the files we are actually parsing. If you are using an IDE extension to help manage SVN then that's a possibility, but I would not expect it to show up like this.

Solution specific makes sense, and in a way is reassuring. Now if we can just work out what the trigger is, hopefully we can find a solution.

What do you have the two VA options:

VA Options -> Correction -> Convert dot to -> if operator -> is overloaded

VA Options -> Performance -> Parse all files when opening a project

set to?

VA does indeed maintain a cache of parsed information. To rebuild this cache, simply press the button:

VA Options -> Performance -> Rebuild symbol databases

and restart the IDE. This will reparse both your stable include directories and your solution, so it may take several minutes, depending on the amount of code involved.

If this does not help, while you are seeing the problem, can you please place the caret into "CString" and see what VA shows in the Context and Definition fields, these are normally at the top of the editor window, where the Alt-M list appears. I am seeing:

Context = CString
Definition = typedef ATL::CStringT< TCHAR, StrTraitMFC< TCHAR > > CString

Alt-g on CString offers me "afxstr.h:99" and "afxstr.h:105", both taking me to the file:

C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\atlmfc\\include\\afxstr.h

I am wondering if you will get different results. If something in your solution is introducing a different definition for CString that should show up here, and could well explain the problem.
HansSch Posted - Nov 25 2015 : 03:03:55 AM
This is really weird. Sometimes the problem goes away when I delete a folder of source files, but when I restore the folder, it doesn't come back. Then it comes back when I restore a different folder, and doesn't go away when I delete that folder. Sometimes it comes or goes away after deletion of the "ipch" folder. I know this type of software behavior from using uninitialized variables, or when overwriting memory behind a buffer - which brings me to the topic of path lengths. The longest path in the project (drive, directory, file name and extension) is 197 characters, all from the ANSI charset.
Are any conflicts possible between VA and TortoiseSVN?
HansSch Posted - Nov 25 2015 : 02:25:12 AM
Does VA maintain any caches outside the project directory tree which I could delete?
HansSch Posted - Nov 25 2015 : 02:23:32 AM
Ok... the problem is connected to one VC++ project. To see the problem, it is sufficient to include the project in a solution. I went back in our subversion repository to see when the problem started to show and didn't find a version of this project where it wasn't there. (Of course I deleted all generated files before checking out the sources, and I checked them out to a different path.) This is going to get mysterious!

Hans
HansSch Posted - Nov 25 2015 : 01:36:45 AM
feline, you are right - the issue is project specific. I'm going to narrow this down as best I can.
Hans
feline Posted - Nov 24 2015 : 3:48:29 PM
Strange, so far I cannot reproduce this problem. If you make a new, default MFC project, do you still see this problem? I am wondering if this could somehow be a file or project specific problem.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000