_purecall

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at _purecall.

The default pure virtual function call error handler. The compiler generates code to call this function when a pure virtual member function is called.

Syntax

extern "C" int __cdecl _purecall();  

Remarks

The _purecall function is a Microsoft-specific implementation detail of the Microsoft Visual C++ compiler. This function is not intended to be called by your code directly, and it has no public header declaration. It is documented here because it is a public export of the C Runtime Library.

A call to a pure virtual function is an error because it has no implementation. The compiler generates code to invoke the _purecall error handler function when a pure virtual function is called. By default, _purecall terminates the program. Before terminating, the _purecall function invokes a _purecall_handler function if one has been set for the process. You can install your own error handler function for pure virtual function calls, to catch them for debugging or reporting purposes. To use your own error handler, create a function that has the _purecall_handler signature, then use _set_purecall_handler to make it the current handler.

Requirements

The _purecall function does not have a header declaration. The _purecall_handler typedef is defined in <stdlib.h>.

See Also

Alphabetical Function Reference
_get_purecall_handler, _set_purecall_handler