Méthode IBackgroundCopyJob::SetNotifyInterface

Identifie votre implémentation de l’interface IBackgroundCopyCallback pour l’optimisation de la distribution. Utilisez l’interface IBackgroundCopyCallback pour recevoir une notification des événements liés au travail.

Syntaxe

HRESULT SetNotifyInterface(
   IUnknown *pNotifyInterface
);

Paramètres

pNotifyInterface

Pointeur d’interface IBackgroundCopyCallback . Pour supprimer le pointeur d’interface de rappel actuel, définissez ce paramètre sur NULL.

Valeur retournée

Cette méthode retourne les valeurs HRESULT suivantes, ainsi que d’autres.

Code de retour Description
S_OK
Le pointeur de l’interface de notification a été correctement défini.

Notes

Appelez cette méthode uniquement si vous implémentez l’interface IBackgroundCopyCallback . Utilisez la méthode SetNotifyInterface conjointement avec la méthode SetNotifyFlags pour spécifier le type de notification que vous souhaitez recevoir.

L’interface de notification devient non valide lorsque votre application se termine ; L’optimisation de la distribution ne conserve pas l’interface de notification. Par conséquent, le processus d’initialisation de votre application doit appeler la méthode SetNotifyInterface sur les travaux existants pour lesquels vous souhaitez recevoir une notification. Si vous devez capturer les informations d’état et de progression qui se sont produites depuis la dernière exécution de votre application, interrogez les informations d’état et de progression pendant l’initialisation de l’application.

Seul le propriétaire/créateur du travail ou un administrateur peut s’inscrire aux notifications.

Spécifications

Condition requise Valeur
Client minimal pris en charge
Windows 10, version 1709 [applications de bureau uniquement]
Serveur minimal pris en charge
Windows Server, version 1709 [applications de bureau uniquement]
En-tête
Deliveryoptimization.h
IDL
DeliveryOptimization.idl
Bibliothèque
Dosvc.lib
DLL
Dosvc.dll
IID
IID_IBackgroundCopyJob est défini comme 37668D37-507E-4160-9316-26306D150B12

Voir aussi

IBackgroundCopyJob

IBackgroundCopyCallback

IBackgroundCopyJob::GetNotifyInterface

IBackgroundCopyJob::SetNotifyFlags