私は Windows 8 アプリ (C++) に取り組んでいます。Windows 8 サンプル コレクションの httpclient クラスを使用しました。
inline void CheckHResult(HRESULT hResult)
{
if (hResult == E_ABORT)
{
concurrency::cancel_current_task();
}
else if (FAILED(hResult))
{
throw Platform::Exception::CreateException(hResult);
}
}
アプリがインターネットに接続されていない場合、この関数は例外をスローします。このように、次のラムダで例外をキャッチしようとしています。
return completionTask.then([this, stringCallback](tuple<HRESULT, wstring> resultTuple)
{
try
{
CheckHResult(std::get<0>(resultTuple));
}
catch(Exception^ ex)
{
}
return std::get<1>(resultTuple);
});
しかし、まだ未処理の例外が表示されています:
First-chance exception at 0x77194B32 in Sample.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x08C7EDF4. HRESULT:0x800C0005
If there is a handler for this exception, the program may be safely continued.
私が間違っていることはありますか?