Example:
#include <System.Math.hpp>
typedef int (*PFNAddFunction)(int, int);
void testDllCall()
{
//Mask Exception
TFPUExceptionMask fExceptionMask ;
fExceptionMask=GetExceptionMask();
fExceptionMask << exInvalidOp;
fExceptionMask << exDenormalized;
fExceptionMask << exZeroDivide;
fExceptionMask << exOverflow;
fExceptionMask << exUnderflow;
fExceptionMask << exPrecision;
SetExceptionMask(fExceptionMask);
//Call DLL
HMODULE _dll=LoadLibraryA("dllName.dll");
if(_dll != NULL) {
PFNAddFunction myAdd = (PFNAddFunction)GetProcAddress(_dll,"funcAdd");
myAdd(1,2)
FreeLibrary(_dll);
}
}
[Reference]
https://delphi.fandom.com/wiki/SetExceptionMask_Routine
http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Math.SetExceptionMask