This Blog Has Been Moved !
This Blog Has been moved to http://aleemkhan.wordpress.com
There is a small problem with System.Drawing.dll in VS.NET 2003. Sometimes you get an Arithmetic Exception and the program is terminated. If u get this "Arithmetic Exception" in System.Drawing.dll, then there must be some spy software or some virus installed on your system which has hooked the system and changed the FPU (FloatingPoint Unit value) for all the processes.
To Set the FPU value to dafault u can use _controlfp() function defined in "msvcrt.dll". This is a native function, to call this function in C# u will have to use .NET Runtime Interop Services. To do this add the following lines of code to your Form class
Now call this function at the start of your form constructor
The FPU value is now set to default and you will not get any Exception in system.Drawing.dll
RSS Feed for this Site
Archives by Date