共用方式為


__dllonexit

在結束時註冊要呼叫的常式。

語法

_onexit_t __dllonexit(
   _onexit_t func,
   _PVFV **  pbegin,
   _PVFV **  pend
   );

參數

func
要在結束時執行的函式指標。

pbegin
變數指標,指向要在中斷連結時執行的函式的清單開頭。

pend
變數指標,指向要在中斷連結時執行的函式的清單結尾。

傳回值

如果成功,則為使用者函式的指標。 否則為 NULL 指標。

備註

函式與函 __dllonexit 式類似 _onexit ,不同之處在于該函式所使用的全域變數在此常式中看不到。 此函數使用 pbeginpend 參數,而不是全域變數。

DLL 中與 MSVCRT.LIB 連結的 _onexitatexit 函式,必須維護其本身的 atexit/_onexit 清單。 此常式是這類 DLL 呼叫的背景工作。

_PVFV 類型定義為 typedef void (__cdecl *_PVFV)(void)

需求

常式 必要檔案
__dllonexit onexit.c

另請參閱

_onexit, _onexit_m