Open jnm2 opened 7 months ago
@Reflectronic suggested something that worked, and opens up a new avenue to explore:
[Guid("E7A1AF80-4D96-11CF-960C-0080C7F4EE85"), InterfaceType(ComInterfaceType.InterfaceIsDual), ComImport]
interface IShellFolderViewDual
{
/// <summary>Gets the application object.</summary>
/// <returns>
/// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://docs.microsoft.com/windows/win32/api//shldisp/nf-shldisp-ishellfolderviewdual-get_application">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
object Application
{
[return: MarshalAs(UnmanagedType.IUnknown)]
get;
}
// Other members omitted
}
I think we can tell that this MarshalAs is needed due to the documented signature of get_Application
at https://learn.microsoft.com/en-us/windows/win32/api/shldisp/nf-shldisp-ishellfolderviewdual-get_application:
HRESULT get_Application(
[out] IDispatch **ppid
);
1050 broke this at the same time as fixing #862. It changed both interfaces from
InterfaceIsIDispatch
toInterfaceIsDual
, butIShellFolderViewDual
currently only works asInterfaceIsIDispatch
.Repro
Workaround
Declare the same interface but with
InterfaceIsIDispatch
: