Last active
November 30, 2017 14:31
-
-
Save kennykerr/fdb696fcb6c01ff9c50b03b5f6beb2fa to your computer and use it in GitHub Desktop.
How to define a custom delegate for an event in IDL
This file contains hidden or 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
runtimeclass Events; | |
[version(1.0), uuid(da38922c-3d3a-404f-8477-de9c104c4f34)] | |
delegate HRESULT CustomDelegate([in] int value); | |
[version(1.0), uuid(6ac35d2c-b2cf-4c36-995c-a9c0764636c9), exclusiveto(Events)] | |
interface IEvents : IInspectable | |
{ | |
[eventadd] HRESULT CustomEvent([in] CustomDelegate* handler, [out][retval] EventRegistrationToken* cookie); | |
[eventremove] HRESULT CustomEvent([in] EventRegistrationToken cookie); | |
}; | |
[version(1.0), activatable(1.0), static(IEventsStatics, 1.0)] | |
runtimeclass Events | |
{ | |
[default] interface IEvents; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment