question

winrtcapture-7351 avatar image
0 Votes"
winrtcapture-7351 asked winrtcapture-7351 commented

windows graphics capture

 virtual HRESULT STDMETHODCALLTYPE add_FrameArrived(                
 __FITypedEventHandler_2_Windows__CGraphics__CCapture__CDirect3D11CaptureFramePool_IInspectable* handler,
 EventRegistrationToken* token
 ) = 0;

129478-image.png



How to use it?
can you please provide me with sample code?

windows-uwp
image.png (60.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
1 Vote"
Castorix31 answered winrtcapture-7351 commented
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you,C++/WinRT is an entirely standard modern C++17 language projection for Windows Runtime (WinRT) APIs,so I want to know how to port C++/WinRT code to its equivalent in Windows Runtime C++ Template Library (WRL) (C++11

0 Votes 0 ·

Thanks!

0 Votes 0 ·
    Microsoft::WRL::ComPtr<
       ABI::Windows::Graphics::Capture::IDirect3D11CaptureFramePool>
       frame_pool_;
    
  auto frame_arrived_handler =
       Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler<
           WGC::Direct3D11CaptureFramePool*, IInspectable*>>(
           this, &WgcWindowSession::OnFrameArrived);
   EventRegistrationToken frame_arrived_token;
   hr = frame_pool_->add_FrameArrived(frame_arrived_handler.Get(),
                                      &frame_arrived_token);

ERROR: hr = RO_E_MUST_BE_AGILE

It didn't work,what's the matter?

0 Votes 0 ·
    Microsoft::WRL::ComPtr<
       ABI::Windows::Graphics::Capture::IDirect3D11CaptureFramePool>
       frame_pool_;
    
  auto frame_arrived_handler =
       Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler<
           WGC::Direct3D11CaptureFramePool*, IInspectable*>>(
           this, &WgcWindowSession::OnFrameArrived);
   EventRegistrationToken frame_arrived_token;
   hr = frame_pool_->add_FrameArrived(frame_arrived_handler.Get(),
                                      &frame_arrived_token);

ERROR: hr = RO_E_MUST_BE_AGILE

It didn't work,what's the matter?

0 Votes 0 ·