この記事のコードを使用して、特大アイコンを抽出しています。UI スレッドからメソッド GetIcon を呼び出す限り、すべて正常に動作します。しかし、他のスレッドから呼び出すと、このエラーがスローされます
Unable to cast COM object of type 'System.__ComObject' to interface type 'IImageList'.
This operation failed because the QueryInterface call on the COM component for the interface with IID
'{46EB5926-582E-4017-9FDF-E8998DAA0950}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
UI スレッドを使用して何千ものアイコンを抽出することはできません。解決策はありますか?