JCL Help:SetVirtualMethod

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Changes a virtual method to the given method.


Pascal

 procedure SetVirtualMethod(AClass: TClass; const Index: Integer; const Method: Pointer);


Parameters

Parameters Description
AClass: TClass The class for which to set a virtual method.
const Index: Integer The index of the virtual method to be set.
const Method: Pointer The new address of the virtual method.


Description

Changes a virtual method to the given method. Do NOT use this function. There should be no need to use this function unless your implementing a very dirty hack. There is no checking performed that the Index is a valid virtual method index. The function only changes the pointer in the VMT of the specified class, not the static references to this method, which are made when an anchestor uses inherited to call the virtual method. This procedure changes the executable code (with the risk of completly destroying your application) and uses WriteProcessMemory to accomplish that. The function is multiprocessor safe.


See Also

GetVirtualMethodCount GetVirtualMethod


About

Unit

JclSysUtils


Donator

Python


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page