I'm working with a C project that's using DirectX and I've run into a problem. Certain DX calls require a IID
object, typically generated with __uuidof
. One thing this is required for is creating a RenderTargetView. The DirectX samples/tutorials do this:
ID3D11Texture2D* pBackBuffer = NULL;
hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer );
When I try to call __uuidof
in my C code, I get an compiler error: Error 19 error C4233: nonstandard extension used : '__uuidof' keyword only supported in C++, not C
. DirectX has a C interface, so I imagine there must be a way to do this, but I have no idea what it would be. Anyone know?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…