DeviceInformationCollectionの列挙はrange-based forでも列挙できた。

公開:2012-03-19 11:45
更新:2020-02-15 04:37
カテゴリ:dawもどきの作成,winrt,c++/cx,windows,c++,audio

DeviceInformationCollectionの列挙はrange-based forでもできた。


DeviceInformation::FindAllAsync(DeviceClass::AudioRender)->Completed 
    = ref new AsyncOperationCompletedHandler<DeviceInformationCollection^>(
    [=] (IAsyncOperation<DeviceInformationCollection ^>^ asyncInfo,  AsyncStatus asyncStatus)
{
    if(asyncStatus == AsyncStatus::Completed)
    {
        DeviceInformationCollection ^col = asyncInfo->GetResults();
        for(auto i :  col)
        {
            this->Information_->Text += i->Name + L"\n";
        }
    }
},Platform::CallbackContext::Same
);