Hi Biterider!
Playing with the idea of overloading, I make it to work after a while.
VirtualMethod macro MName:req, Args:vararg
MNameO textequ @CatStr (&MName , argcount(Args))
PrototypeMethod %ObjName, %MNameO, Args
% ??Index = &ObjName&_VtlMtdCount + 1
% &ObjName&_VtlMtdCount = ??Index
% @CatStr(%ObjName, <_VtlMethod_Name_>, %??Index) textequ <MNameO>
% @CatStr(%ObjName, <_VtlMethod_Proc_>, %??Index) textequ <offset @CatStr(&ObjName&,<_>, %MNameO)>
% @CatStr(%ObjName, %MNameO,<_Access>) = ??MethodAccess
endm
Very clear in VirtualMethods: VirtualMethod InitSerie, DWORD, DWORD, DWORD ;-> Prioridad, Color, Modalidad
VirtualMethodO InitSerie, DWORD, DWORD ;-> Modalidad, Color o puntero a estructura
Not so nice when RedefineMethod: RedefineMethod Init, DWORD, DWORD, DWORD ;-> Prioridad, Color, Modalidad
VirtualMethodO Init, DWORD, DWORD ;-> Prioridad, Color, Modalidad
In this case the overloading is by number of arguments, but it's posible also by argument types.
I don't know if worth the additional preprocessing. Now I only testing without change main macros, instead I added VirtualMethodO, MethodO and OCallO.
Regards. HSE