Error 517 - OPTIONAL requires CDECL or SDECL

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