Note: Using the SDK in a WPF Application

Symptom: Using the FBEditor, FBLog or FBVDisk classes in a WPF application causes arithmetic overflow exceptions.

Cause: SDK classes have been created with Borland C++ Builder, which uses Floating Point Unit (FPU) exceptions, where WPF does not and this puts the FPU into a state incompatible with WPF.

Workaround: throwing and catching a dummy exception can be used to reset the FPU state after creating an FBEditor, FBLog or FBVDisk object. For example:

        

            FBEditor _fbEditor = new FBEditor();

            try { throw new Exception("Ignore this please, resetting the FPU"); }

            catch (Exception ex) { }