Fatalexecutionengineerror was detected

Hi

I am trying to save the chart(MS chart control 6.0) as an image(bitmap) file. Its working fine in Visual Studio 2003 but when I try to run the same program in VS 2005 the following error is thrown up at runtime.

 

Fatalexecutionengineerror was detected

The runtime has encountered a fatal error. The address of the error was at 0x7a005c3d, on thread 0xfdc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Here is the sample code that i am working with.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim x As IDataObject

Dim img As Bitmap

Chart1.EditCopy()

x = Clipboard.GetDataObject() ********** the error comes over here

img = x.GetData(DataFormats.Bitmap, True)

img.Save("c:\img1.bmp")

End Sub

Can anyone help me on this.

or

Is there any other way that I can save the chart as an image file

Thanks

 



Answer this question

Fatalexecutionengineerror was detected

  • Fatalexecutionengineerror was detected