Expand Minimize

RoRegisterForApartmentShutdown function

Registers an IApartmentShutdown callback to be invoked when the current apartment shuts down.

Syntax


HRESULT WINAPI RoRegisterForApartmentShutdown(
  _In_   IApartmentShutdown *callbackObject,
  _Out_  UINT64 *apartmentIdentifier,
  _Out_  APARTMENT_SHUTDOWN_REGISTRATION_COOKIE *pRegCookie
);

Parameters

callbackObject [in]

The application-supplied IApartmentShutdown interface.

apartmentIdentifier [out]

The identifier for the current apartment.

pRegCookie [out]

A cookie that you can use to unregister the callback.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

To receive apartment shutdown notifications, your app must register its apartment shutdown handler with the system by calling the RoRegisterForApartmentShutdown function.

Warning  

Don't call the RoRegisterForApartmentShutdown function from the OnUninitialize callback.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Roapi.h

See also

IApartmentShutdown
RoUnregisterForApartmentShutdown

 

 

Community Additions

ADD
Show:
© 2014 Microsoft