Cartman. Posted June 27, 2014 Report Posted June 27, 2014 There are actually a few ways of going about calling your functions dynamically.Let us look at one (needing the usage of Classes.pas - adds extra size to the stub/output)program prjCallFuncDynm;uses Windows, Classes;Type TDCFunction = function: string of object; TDClass = Class (TPersistent) function xMain: string; End;function TDClass.xMain;begin Result := 'Gogaie valorosu?';end;function xTDC(xTMN:String;xClass:String): string;var m: TMethod; xTClass:TPersistentClass;begin xTClass := GetClass(xClass); m.Code := xTClass.MethodAddress(xTMN); m.Data := pointer(xTClass); Result := TDCFunction(m);end;begin RegisterClasses([TDClass]); MessageBox(0,PWideChar(xTDC('xMain','TDClass')),'OpenSC',0);end.And a different method not using Classes.pas would be as follows:program prjCallFuncDynm;uses Windows;Var pMain:function:String;stdcall;function xMain:string;stdcall;begin Result := 'Gogaie valorosu?';end;Exports xMain;begin pMain := GetProcAddress(0,'xMain'); MessageBox(0,PWideChar(pMain),'OpenSC',0);end. Quote