Is there a way in Visual Studio 2022 to easily view a C++ object's nested values in Watch window? [duplicate] - visual-c++

This question already has answers here:
debug visualizer of C++ custom types for Visual Studio
(1 answer)
visual studio debugger graphical visualizer c++
(1 answer)
How to write a custom native visualizer DLL for Visual Studio 2012 debugger?
(3 answers)
Visual C++ debugger visualizer?
(3 answers)
Closed last month.
In .NET managed code there is a DebuggerDisplayAttribute, so an object's most important values can easily be observed during a debugging session in Visual Studio 2022 without being required to drill deep into the object's properties everytime.
Is there something similar for C++ in Visual Studio 2022?
I feel it's hard to observe std::string or std::list<std::string>, for example, without such comfort.

Related

How to hide horizontal and vertical guide lines for dart code in Android Studio [duplicate]

This question already has an answer here:
How to get rid of these vertical lines in the editor
(1 answer)
Closed 3 years ago.
I use Android Studio 3.4.1 for Flutter development with dart language and I want to remove these -not so useful- helping lines in dart pages, How can I do that in Android Studio Settings?
You can enable/disable this by going to Settings > Languages & Frameworks > Flutter. Then in the Editor section, unckeck Show UI Guides for build methods.

Android NDK include of math.h gives "use of undeclared identifier" error

I've a solution containing two project types .androidproj (Android) and .vcxproj (C++) in my Visual Studio 2017 Community Edition. I use android-ndk-r13b for the C++ part.
Since the update from Visual Studio 2017 Community Edition version 15.5.7 to 15.6.1 (release notes) I experience the following blocking error:
error : use of undeclared identifier 'acosl'
See the representing lines in the build output:
In file included from C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\android\support\include\math.h:31:
C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b\sources\cxx-stl\llvm-libc++\include\math.h(661,91): error : use of undeclared identifier 'acosl'
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
Next to the acosl also all other math functions are not found.
Unfortunately those Posts didn't help in my case:
Visual Studio 2015, Android NDK with libc++ and cmath issues
Visual Studio 2017 Android NDK math.h
Any hints what I could try?
Update
The minSdkVersion is set to 15. The solution compiled before the Visual Studio update without errors.
With 15.6 they seem to have introduced a change in the MSBuild file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Android\3.0\Default.props" which contains a bunch of default input values (MSBuild properties) for the Android build process of Visual Studio.
The change that causes this issue is the new default value of the UseOfStl which is now c++_static while in previous releases it was gnustl_static.
As mentioned this is only a default value so you can fix this by explicitly setting the proper value, c++_static in this case, in your affected vcxproj files.
The easiest way to do so is to open the properties page of your vcxproj and in the "General" page set the "Use of STL" to "GNU STL static library (gnustl_static)" as shown in the screenshot.
Note that this issue has been posted as a bug here: https://developercommunity.visualstudio.com/content/problem/211533/visual-studio-update-156-breaks-c-android-app-buil.html

Visual Studio dots showing brace connection ( similar to sublime )

I write C#, UnrealScript and C++. I do C++ and C# in Visual Studio 2012, while I do UnrealScript in Sublime 2 with UnrealScript IDE plugin
In Sublime 2 there is a cool effect that shows the line connection between the open and close braces as shown in the image:
( Note: I'm not talking about the underlining of the braces - VS already has that feature. I'm referring to the dotted lines )
I can't find a way to have this in Visual Studio, the closest so far is Show White Space which while is OK, I don't like it that much. Is there a way I can have this feature? Plugin or otherwise?
Try installing a free version of DevExpress Plugin for Visual Studio. Its got all those designes....

How to display native types when debugging in VS2012 for mixed mode C++/CLI MFC app

Possible duplicate of this question.
I have a MFC project that uses /clr switch and some C++/CLI code to use a .Net component. Originally this was on VS2005.
On upgrading to VS2012 Update 2, during debugging, no values or types were shown for native data types. I learned that a new mechanism for native data type visualization (natvis) was introduced in VS2010 and extended / enhanced in VS2012. Following the information on that page, I unchecked Managed C++ Compatibility Mode and C/C++ edit and continue. After this, breakpoints became disabled and stopped being hit. Using "Only Managed" debugger, the breakpoints were hit but no values were shown.
Finally, I used "mixed" debugger and used __debugbreak() to force a break. This resulted in only integer values being shown ONLY if they are local autos; and data types were picked up correctly. However, std::string or CString values are not shown and instead their type is shown in value column. Similarly, pointers, class members, or functions argument values are not shown and type information, Undefined value, or out of scope is shown in the value column.
The behavior is consistent across autos, locals and watch windows as well as mouse hover on symbols.
How do I get the native data types to display their values during debugging in VS2012 mixed mode C++/CLI MFC application.
I have read this question and verified that all symbols have been loaded in modules window.
Apparently, Microsoft is aware of the issue and the upcoming CTP of Update 3 should fix it.
Additionally, why do I need to use __debugbreak()?
A couple of days ago, Microsoft released a Visual Studio Service Pack 3 RC which may help (installing it myself right now). Here is the link: http://www.microsoft.com/en-us/download/details.aspx?id=38832
Re-install Visual Studio 2012 and do not apply Service Pack 2.

Free Visual Studio Pluggin For Code COmpletion in Visual C++

I am doing some C++ projects in visual c++ using Visual Studio Pro 2010. But unfortunately, auto complete support, automatic brace completion are not there. For example, If you type "in", there is not auto completion pop up windows showing that "Int", if u type "ret", nothing is shown for "return", these simple auto completion feature are available in netbeans, eclipse. But not in VS.
I used Visual assist x for a month but it is not a free extension. Can someone help???? is there any free pluggin that can do these things in C++...
There are also good pluggin that serves these issues like resharper. But all these works for C# and VB
Auto completion should be available trough Visual Studio directly. As for extra options this may not do all that you're used to with Visual Assist X, but it's free and it helps you make some changes to the code very easily: DevExpress Refactor! for C++

Resources