Resetting the FPU mask in C#

  • Thread starter Thread starter Marcus P.
  • Start date Start date
M

Marcus P.

Hi,

I have a COM server that appears to be stepping on the FPU mask for my
client program.

In the short term, before I get the COM server fixed I have read that I can
manually reset the FPU mask after the unmanaged call to the COM server.
However I have only found examples of how to do this in VB using
"controlfp". How do I link to this function from inside a C# program? Does
anyone have example code for this?

Thanx.
Z.
 
Marcus said:
Hi,

I have a COM server that appears to be stepping on the FPU mask for my
client program.

In the short term, before I get the COM server fixed I have read that I can
manually reset the FPU mask after the unmanaged call to the COM server.
However I have only found examples of how to do this in VB using
"controlfp". How do I link to this function from inside a C# program? Does
anyone have example code for this?

Thanx.
Z.

[System.Runtime.InteropServices.DllImport("msvcrt.dll")]
private int _controlfp(int IN_New, int IN_Mask);

int _MCW_EW = 0xH8001F;
int _EM_INVALID = 0xH10;

private void FixFPU()
{
_controlfp(_MCW_EW, _EM_INVALID);
}

LP,
Dejan
 
Back
Top