CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Strange red blocks in Editor window

    Does anyone know what these strange red blocks mean on my scroll bar (in VS2019) ?

    They aren't related to the source lines - i.e. if I scroll the text window, the blocks remain in the same positions; they don't move as I scroll. And I only ever see them if I load one particular source file - even if it's unedited and even if I close that file and re-open it...

    Name:  Capture-19.jpg
Views: 81
Size:  26.2 KB
    "A problem well stated is a problem half solved. - Charles F. Kettering

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    They show you the places (the lines) where intellisense has found the errors.
    Note that sometimes it sucks!
    You can switch to show only the build errors though.
    Victor Nijegorodov

  3. #3
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    Victor Nijegorodov

  4. #4
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    Thanks Victor - I followed a few links and found some advice about finding the project's .vs folder and deleting the .suo file. Then there were other suggestions about deleting everything there except for the .suo file. But neither of them helped.

    Eventually I discovered that this particular source file has got its own .ipch file. I've no idea why - because the project must have well over 1,000 source files but only about 4 of them have their own .ipch file. Anyway - deleting the .ipch file has fixed the problem
    "A problem well stated is a problem half solved. - Charles F. Kettering

  5. #5
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    Glad you've solved this problem!
    Victor Nijegorodov

  6. #6
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    What I seem to get now (with some files) is grey blocks rather than the red ones. I assumed maybe they'd indicate warnings, rather than errors... But what's weird is that if I compile just that particular file, it doesn't give me any warnings, or errors or even messages - just the grey blocks for some reason
    "A problem well stated is a problem half solved. - Charles F. Kettering

  7. #7
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    Yes, there are some "low level important" warnings like not initialized arrays, suggestions to to use constexpr instead of #define and so on...
    Victor Nijegorodov

  8. #8
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,648

    Re: Strange red blocks in Editor window

    Have you tried installing the Intellisense Extender as an extension? It provides additional info re potential code issues.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.3.0)

  9. #9
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    Quote Originally Posted by 2kaud View Post
    Have you tried installing the Intellisense Extender as an extension? It provides additional info re potential code issues.
    I didn't.
    Victor Nijegorodov

  10. #10
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    Me neither. What's weird is that the blocks don't seem to correspond to specific lines. So if I scroll the Editor window, the blocks remain in their initial positions. And even if I close the project then delete the .ipch file, then re-open and re-compile, the blocks come back in the same positions (even though the Editor window is now showing different text).
    "A problem well stated is a problem half solved. - Charles F. Kettering

  11. #11
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    Quote Originally Posted by John E View Post
    Me neither. What's weird is that the blocks don't seem to correspond to specific lines. So if I scroll the Editor window, the blocks remain in their initial positions. And even if I close the project then delete the .ipch file, then re-open and re-compile, the blocks come back in the same positions (even though the Editor window is now showing different text).
    I agree, it's not so easy to find out where exactly the problem is.
    You have to find such a grey dashed underline:
    Name:  Grey Blocks.jpg
Views: 43
Size:  14.3 KB
    and see its tooltip.
    Victor Nijegorodov

  12. #12
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    Wow - well spotted! For the most part, my messages (mostly with red lines) are saying incomplete type is not allowed

    And yet these don't seem to be programming errors AFAICT. They're statements which are annoying intellisense for some reason.

    In fact, the vast majority of c'tors and d'tors give me the above error - but only in the affected source files which are just a tiny number of the overall sources.
    "A problem well stated is a problem half solved. - Charles F. Kettering

  13. #13
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    VictorN - what tool did you use to make your screenshot? I've tried Snipping Tool and also Snip & Sketch - but if I try to use them while there's a popup on-screen, the popup always disappears
    "A problem well stated is a problem half solved. - Charles F. Kettering

  14. #14
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,266

    Re: Strange red blocks in Editor window

    John, I usually use Win + Shift + S (I don't know how it is called! )
    Victor Nijegorodov

  15. #15
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,799

    Re: Strange red blocks in Editor window

    Quote Originally Posted by VictorN View Post
    John, I usually use Win + Shift + S (I don't know how it is called! )
    Ah yes, that's Snip & Sketch. It does work here if I'm very careful...

    So how do you get those very neat red highlights? I can use the pen tool here but it's not exactly neat...
    "A problem well stated is a problem half solved. - Charles F. Kettering

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured