Open hughbe opened 4 years ago
I don't think this needs any implementation change, its not technically wrong, interface inheritance in managed and native code means different things. The way its done just forces implementing classes to implement both interfaces while the native API allows implementing them individually.
The point is that its easy to mix up the docs of native/managed interfaces since they are sharing the same name and GUID and all. It might be worth highlighting the differences to avoid people making mistakes.
See https://github.com/dotnet/winforms/pull/3231#discussion_r427133765
IRawElementProviderHwndOverride
inherits fromIUnknown
only: https://github.com/tpn/winsdk-10/blob/9b69fd26ac0c7d0b83d378dba01080e93349c2ed/Include/10.0.10240.0/um/UIAutomationCore.idl#L401-L410In https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-irawelementproviderhwndoverride
However, the .NET API docs https://docs.microsoft.com/en-us/dotnet/api/system.windows.automation.provider.irawelementproviderhwndoverride?view=netcore-3.1 say that it implements
IRawElementProviderSimple
.This may be a bug in the implementation of
IRawElementProviderSimple
inUIAutomationProvider.dll
.I don't know if this can be changed because that could be source breaking. However, we should definitely document the fact that the class shouldn't actually inherit from
IRawElementProviderSimple
.This is especially relevant because the documentation is in conflict between win32 and .NET