Unable to cast COM object of type 'System.__Co

2019-07-20 17:19发布

I'm using this article code to extract the extra large icons. Everything works fine as long as I call its method GetIcon from UI Thread. But if I call from other thread, it throws this error

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)).

I cant use UI thread for extracting thousands of icons. Any solution ?

标签: c# shell
0条回答
登录 后发表回答