Error loading design. C++ Winform

José Carlos 886 Reputation points
2023-01-26T17:35:46.89+00:00

Hi,

I am not able to load the design of a form, but the program works perfectly.

It gives error object reference not set to instance of an object. But it doesn't show what error, line, etc.

How to see the design again?

Tkd

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,595 questions
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,525 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Dimple Rane 906 Reputation points
    2023-01-26T17:41:49.9133333+00:00

    The error "object reference not set to instance of an object" typically occurs when you are trying to access an object that is null or has not been initialized. It's hard to say exactly what the issue is without more information on the specific code and project, but some things you can try include:

    1. Check that all objects being accessed in the form's design have been properly initialized.
    2. Clean and rebuild the solution to ensure that all dependencies are up to date.
    3. Make sure that the form is being loaded correctly, and that the necessary resources are being loaded.
    4. Try to open the form in the designer in safe mode. You can do this by right-clicking the form in Solution Explorer and selecting "View Designer" while holding the Ctrl key. This will open the designer in safe mode and may reveal any issues with the form's design.
    0 comments No comments

  2. José Carlos 886 Reputation points
    2023-01-26T17:51:11.4066667+00:00

    Hi Dimple

    OK.

    I'll try that here.

    Now the message has changed: "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

    Very strange. I didn't change anything in the program.


  3. Minxin Yu 10,031 Reputation points Microsoft Vendor
    2023-01-30T03:02:54.25+00:00

    Hi, José Carlos Souza

    Similar issues have been mentioned on Q&A. You can report this issue to the Developer Community and post the link in the comments.
    https://learn.microsoft.com/en-us/answers/questions/846949/vs2022-c-view-designer-suddenly-refuses-to-work
    https://learn.microsoft.com/en-us/answers/questions/1073331/getting-error-message-catastrophic-failure-(except)

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments