What does ComPtr.As() do?
问题 I am working on learning DirectX 12 from some examples but I am having trouble understanding what does the ComPtr.As() method does. ComPtr<ID3D12Device> device; ComPtr<ID3D12Device> device2; // Do Stuff with Device device.As(&device2); // What does this do? 回答1: Where did you find this example code? It looks fishy. This is kind of a nonsense use of As . It's equally silly if you expand it to the underlying QueryInterface : hr = device->QueryInterface( IID_PPV_ARGS(device2) ); In fact, your