Skip to content

Commit

Permalink
Use COM wrappers type over CsWin32 type
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuelie committed Aug 29, 2024
1 parent 43c86af commit 0b5c8bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Shmuelie.WinRTServer.Windows.Com;
using Windows.Win32.Foundation;
using static Windows.Win32.PInvoke;
using IInspectable = Windows.Win32.System.WinRT.IInspectable;

namespace Shmuelie.WinRTServer.Internal;

Expand All @@ -24,7 +23,7 @@ public unsafe HRESULT ActivateInstance(void** instance)
{
object managedInstance = factory.ActivateInstance();
unknown = comWrappers.GetOrCreateComInterfaceForObject(managedInstance, CreateComInterfaceFlags.None);
var riid = IInspectable.IID_Guid;
var riid = global::Windows.Win32.System.WinRT.IActivationFactory.IID_Guid;
var hr = (HRESULT)Marshal.QueryInterface(unknown, ref riid, out nint ppv);
shouldReleaseUnknown = true;
if (hr.Failed)
Expand Down
1 change: 0 additions & 1 deletion src/Shmuelie.WinRTServer/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ GLOBALOPT_RO_FLAGS
HRESULT
HSTRING
IGlobalOptions
IInspectable
IUnknown
RoInitialize
RoRegisterActivationFactories
Expand Down

0 comments on commit 0b5c8bd

Please sign in to comment.