Problems after migration from VS 2013 to VS 22 in Visual C++

Claudio 1 Reputation point
2023-01-10T09:06:46.157+00:00

Hi guys,

I've a large visual c++ project migrated from vs2013 to Visual studio 2022. All went fine for almost of the binaries except for one of them that crashed soon after started. Debugging it, it seems that due to heap problems some HWND belonging to some buttons of a CFomView become null and the view crashes during the first InitialUpdate routine.

I know that to troubleshoot such a problem could be a nightmare, so I ask suggestions about what kind of tools I could use to understand and fix the problem..

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,830 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,017 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Claudio 1 Reputation point
    2023-01-10T16:23:06.853+00:00

    I think that the problem is solved. One of the external library used a directive #pragma pack (1) before an union, but no #pragma pack() were used to restore the default packaging.. This causes a misalignment that in my case means "crash".. I fixed the code of the external library and no need to change the default structure alignment of the project.

    The question could be why this error raised only moving the project to VS2022, but I suppose that the answer should go deeper inside the compilation process..

    All the best!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.