-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ITypeInfo directly instead of CreateStdDispatch
- Loading branch information
1 parent
77c244f
commit 6b9e3c4
Showing
10 changed files
with
137 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Jeremy W. Kuhne. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Windows.Win32.System.Com; | ||
using Windows.Win32.UI.Accessibility; | ||
|
||
namespace Windows.Accessibility; | ||
|
||
/// <summary> | ||
/// Base <see cref="IDispatch"/> class for <see cref="IAccessible"/>. | ||
/// </summary> | ||
public unsafe abstract class AccessibleDispatch : StandardDispatch<IAccessible> | ||
{ | ||
// The accessibility TypeLib- lives in oleacc.dll | ||
private static readonly Guid s_accessibilityTypeLib = new("1ea4dbf0-3c3b-11cf-810c-00aa00389b71"); | ||
|
||
// We don't release the ITypeInfo to avoid unloading and reloading the IAccessible ITypeLib. | ||
private static ITypeInfo* TypeInfo { get; } = ComHelpers.GetRegisteredTypeInfo(s_accessibilityTypeLib, 1, 1, IAccessible.IID_Guid); | ||
|
||
public AccessibleDispatch() : base(TypeInfo) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Jeremy W. Kuhne. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Windows.Win32.System.Com; | ||
|
||
/// <summary> | ||
/// Base <see cref="IDispatch"/> class for <see cref="IUnknown"/>. | ||
/// </summary> | ||
public unsafe abstract class UnknownDispatch : StandardDispatch<IUnknown> | ||
{ | ||
// StdOle32.tlb | ||
private static readonly Guid s_stdole = new("00020430-0000-0000-C000-000000000046"); | ||
|
||
// We don't release the ITypeInfo to avoid unloading and reloading the standard OLE ITypeLib. | ||
private static ITypeInfo* TypeInfo { get; } = ComHelpers.GetRegisteredTypeInfo(s_stdole, 2, 0, IUnknown.IID_Guid); | ||
|
||
public UnknownDispatch() : base(TypeInfo) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters