RoRegisterForApartmentShutdown 関数 (roapi.h)

現在のアパートメントがシャットダウンしたときに呼び出される IApartmentShutdown コールバックを登録します。

Syntax

HRESULT RoRegisterForApartmentShutdown(
  [in]  IApartmentShutdown                     *callbackObject,
  [out] UINT64                                 *apartmentIdentifier,
  [out] APARTMENT_SHUTDOWN_REGISTRATION_COOKIE *regCookie
);

Parameters

[in] callbackObject

アプリケーションが提供する IApartmentShutdown インターフェイス。

[out] apartmentIdentifier

現在のアパートメントの識別子。

[out] regCookie

コールバックの登録を解除するために使用できる Cookie。

戻り値

この関数が成功すると、S_OKが返 されます。 それ以外の場合は、HRESULT エラー コードが返されます。

Remarks

IApartmentShutdown インターフェイスを実装するオブジェクトはアジャイルである必要があります。

OnUninitialize コールバックは、シャットダウンするアパートメントのコンテキストで呼び出されます。

コールバックは、呼び出された後に自動的に登録解除されます。

警告  
 
OnUninitialize コールバックから RoRegisterForApartmentShutdown 関数を呼び出さないでください。

Requirements

要件 Value
サポートされる最小クライアント Windows 8 [デスクトップ アプリ |UWP アプリ]
サポートされている最小のサーバー Windows Server 2012 [デスクトップ アプリ |UWP アプリ]
ターゲット プラットフォーム の Windows
Header roapi.h
Library RuntimeObject.lib
DLL ComBase.dll

参照

IApartmentShutdown

RoUnregisterForApartmentShutdown の