https://forum.lazarus.freepascal.org/index.php/topic,47147.0/topicseen.html might be of interest to you despite the title :-) It is about invoke/tvirtualinterface