vs2022 项目构建然后开始调试没有窗口出现

问题描述 投票:0回答:1

项目构建然后我们开始调试窗口没有出现

这出现在 2 天前,同时复制了代码片段 微软学习:

https://learn.microsoft.com/en-us/windows/win32/gdi/rotating-lines-of-text

添加到模板c++窗口桌面时 没有窗口出现 在 vs2022 中打开其他几个应用程序 他们都表现出相同的行为 没有出现“窗口”,

         initially one of these open project
       give the problem for 2 days, 
      till made new application and insert one of the codes above it url
     when it become obvious where the problem
     [yes 2 days for bitmap several codes put together, store, display etc.
      where it made go through every functions and study lot of the bitmap related
     documentation and other web sites on bitmap, lot of reading...lot of code 
       and try them in different ways....
     it made bitmap very clear for me due to their sample and projects
       complicated syntax...  I could not find any thing that can cause such problem]
    initially one of these open project
           give the problem for 2 days, 
          till made new application and insert one of the codes above it url
         when it become obvious where the problem
         [yes 2 days for bitmap several codes put together, store, display etc.
          where it made go through every functions and study lot of the bitmap related
         documentation and other web sites on bitmap, lot of reading...lot of code 
           and try them in different ways....
         it made bitmap very clear for me due to their sample and projects
           complicated syntax...  I could not find any thing that can cause such problem]

          All project closed and just this rotating text as it one of the last
            copied codes,  [placed in new template,] in the application(s) that been closed.
            

           Start Debug    no window appears
           noted in trying to find code problems
           there appeared an icon never seen before, 
            somethin " continue"  when clicked, window appears
           I could not duplicate this behavior 
           green arrow heads "local windows debugger" clicked , window appears.
           this make look at Start-Debug panel Continue clicked
           window appears



        NOW: the additional code removed , template window project15 will not show "window"
      the "window" created because execution done , but not visible?
          new c++ window consol :  the console window appears
     then back to try the win=projxx with and without code , no change
        another console app  -> window appears

        back to win-proj15 again with/without the addition:  start debug ......NO "window"
      new win-proj17, copy the code form  win-proj15 (the new one in the sequence before)
      ...it works  window appears?

         Note it seems compiling the console apps   did cause the change?
        but the win-proj15  or the last project  used at the start win-proj14 (has lot of error?
          in rotate disk code?? which does now show in the other projxx that works) with
        lot of new codes inserted... does not work then and now...
          > remains will not show the window...  this sequences
          new proj(s) I did while writing this question?  the older ones still not working?

         What the cause of all that?

the rotate example has one function 
hr = StringCchLength(lpszRotate, 22, &pcch


    RECT rc;
    int angle;
    HGDIOBJ hfnt, hfntPrev;
    WCHAR lpszRotate[22] = TEXT("String to be 
    rotated.");
    HRESULT hr;
    size_t pcch = 22;// 21 ONLY NOT 22
    //  21+1  SZ STRING  MUST +1 TO COUNT 
     PCCH = COUNT ONLY
    //  WILL NOT WORK

    hr = StringCchLength(lpszRotate, 22, 
    &pcch);
    now I am at the wonproj16 that works fine
    when we place pcch =21 :  the program 
    hang up .... and show window under IDE 
    and give error  

    this the function template in my notes, 
    but the wrong pcch work fine, the correct 
    hang up


 STRSAFEAPI StringCchLengthA(
 [in]  STRSAFE_PCNZCH    psz,   // The string 
 whose length is to be checked.
 [in]  size_t         cchMax,       //"21+1" 
 The maximum number of characters allowed in 
 psz, including the terminating null 
 character.
  [out] size_t         *pcchLength  //  21 
 The number of characters in psz, not 
 including the terminating null character is 
 valid only if pcch is not NULL and the 
 function succeeds.
 );
 Determines whether a string exceeds the 
 specified length, in characters.

do we think some how the VS2022 installation
has corruptions? Document can be wrong
as I seen  just few description mistakes 
around.
?it seems i have problem working with the 
editor,  does not like the image paste!!

Last addition it obvious now something wrong 
with vs2022:  the pcch = 22; which should be 
21, when done this way => hangup the window
when put back pcch = 22; [as initially this 
the working version] it hang up, 
Replace the code with code form version 
winproj17/fine it came back in 
winproj16/fine...
that end this thread context. Thank You

enter image description here

debugging window visual-studio-2022
1个回答
0
投票

如果问题出现在该特定项目中,您可以尝试关闭 Visual Studio,删除项目文件夹下的 .vs 文件夹,然后重新打开并构建项目,看看问题是否再次解决。 enter image description here

如果您在项目文件夹下没有看到 .vs 文件夹,则需要使隐藏项目设置可见。 enter image description here

您还可以使用 Visual Studio 安装程序修复 Visual Studio,以防止安装过程中出现问题。 enter image description here(点击更多并选择修复)

© www.soinside.com 2019 - 2024. All rights reserved.