Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Inscrit un rappel IApartmentShutdown à appeler lorsque l’appartement actuel s’arrête.
Syntax
HRESULT RoRegisterForApartmentShutdown(
[in] IApartmentShutdown *callbackObject,
[out] UINT64 *apartmentIdentifier,
[out] APARTMENT_SHUTDOWN_REGISTRATION_COOKIE *regCookie
);
Parameters
[in] callbackObject
Interface IApartmentShutdown fournie par l’application.
[out] apartmentIdentifier
Identificateur de l’appartement actuel.
[out] regCookie
Cookie que vous pouvez utiliser pour annuler l’inscription du rappel.
Valeur renvoyée
Si cette fonction réussit, elle retourne S_OK. Sinon, elle retourne un HRESULT code d’erreur.
Remarks
L’objet qui implémente l’interface IApartmentShutdown doit être agile.
Le rappel OnUninitialize est appelé dans le contexte de l’appartement qui s’arrête.
Le rappel est automatiquement désinscrit après son appel.
Spécifications
| Requirement | Value |
|---|---|
| Client minimum requis | Windows 8 [applications de bureau | Applications UWP] |
| Serveur minimal pris en charge | Windows Server 2012 [applications de bureau | Applications UWP] |
| plateforme cible | Windows |
| Header | roapi.h |
| Library | RuntimeObject.lib |
| DLL | ComBase.dll |