Error 517 - OPTIONAL requires CDECL or SDECL

OPTIONAL requires CDECL or SDECL - The OPTIONAL (or OPT) clause in a DECLARE, SUB, FUNCTION, METHOD, or PROPERTY statement requires the CDECL or SDECL/STDCALL calling convention. You may not use OPTIONAL or OPT parameters with BDECL calling convention.