注册在退出时要调用的例程。Registers a routine to be called at exit time.


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


指向在退出时要执行的函数的指针。Pointer to a function to be executed upon exit.

指向一个变量的指针,该变量指向要执行拆离的函数列表开端。Pointer to a variable that points to the beginning of a list of functions to execute on detach.

指向一个变量的指针,该变量指向要执行拆离的函数列表末尾。Pointer to variable that points to the end of a list of functions to execute on detach.

返回值Return Value

如果成功,则为指向用户函数的指针。If successful, a pointer to the user’s function. 否则,为 NULL 指针。Otherwise, a NULL pointer.


__dllonexit 函数类似于 _onexit 函数,只不过在此例程中看不到该函数使用的全局变量。The __dllonexit function is analogous to the _onexit function except that the global variables used by that function are not visible to this routine. 此函数使用 pbeginpend 参数而不是全局变量。Instead of global variables, this function uses the pbegin and pend parameters.

DLL 中与 MSVCRT.LIB 链接的 _onexitatexit 函数必须保留自己的 atexit/_onexit 列表。The _onexit and atexit functions in a DLL linked with MSVCRT.LIB must maintain their own atexit/_onexit list. 此例程是由此类 DLL 调用的工作线程。This routine is the worker that gets called by such DLLs.

_PVFV 类型定义为 typedef void (__cdecl *_PVFV)(void)The _PVFV type is defined as typedef void (__cdecl *_PVFV)(void).


例程Routine 所需文件Required file
__dllonexit__dllonexit onexit.conexit.c

另请参阅See Also

_onexit、_onexit_m_onexit, _onexit_m