How do I fix dll exception in win32 app?

JWG 146 Reputation points
2023-03-21T16:15:09.73+00:00

I get an exception on

    d3d11DC->IASetPrimitiveTopology(
        D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);

Exception thrown at 0x00007FFFD5E2D909 (d3d11.dll) in Win32OpenGL.exe: 0xC0000005: Access violation writing location 0x00007FFF3AEDD6B4.

Call Stack :

d3d11.dll!00007fffd5e2d909() Unknown Win32OpenGL2OpenGL.exe!d3dDrawShape() Line 1138 C++ Win32OpenGL.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 2782 C++ [External Code]

How can I fix this error?

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,318 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,586 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
    2023-03-23T02:29:38.1+00:00

    Hello @JWG ,

    Welcome to Microsoft Q&A!

    Your DXGI_SWAP_CHAIN_DESC1 Width and Height is set with wrong value and ID3D11DeviceContext::RSSetViewports is only called at Initialization and after Resized. For how to use, see Interactive3dTextSample. The attached code failed to compile.

    Thank you.


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.