IFunctionDiscoveryNotification interface (functiondiscoveryapi.h)
[Function Discovery is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]
This interface is implemented by the client program to support asynchronous queries and is called by Function Discovery to notify the client program when a function instance that meets the query parameters has been added or removed.
Inheritance
The IFunctionDiscoveryNotification interface inherits from the IUnknown interface. IFunctionDiscoveryNotification also has these types of members:
Methods
The IFunctionDiscoveryNotification interface has these methods.
IFunctionDiscoveryNotification::OnError Receives errors that occur during asynchronous query processing. |
IFunctionDiscoveryNotification::OnEvent Receives any add, remove, or update events during a notification. |
IFunctionDiscoveryNotification::OnUpdate Indicates that a function instance has been added, removed, or changed. |
Remarks
This interface must be implemented by the client program in order to receive notifications from Function Discovery. The address of the client program's implementation is passed to one of the query methods to enable notifications for function instances which meet the query parameters.
Function Discovery calls the client program's IFunctionDiscoveryNotification::OnUpdate method to perform the actual notification, which is generated for a function instance when it is added or removed.
Examples
The examples that appear on individual method pages are based on the following class declaration.
class CMyNotificationListener : public CFunctionDiscoveryNotificationWrapper
{
public:
CMyNotificationListener() {
m_hAddEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
m_hRemoveEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
m_hChangeEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
}
~CMyNotificationListener() {
CloseHandle( m_hAddEvent );
CloseHandle( m_hRemoveEvent );
CloseHandle( m_hChangeEvent );
}
private:
HANDLE m_hAddEvent, m_hRemoveEvent, m_hChangeEvent;
};
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | functiondiscoveryapi.h |