473,504 Members | 13,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.ExecutionEngineException

hi,
i meet a problem when i try to develop an application with an ocx in
c#. the same ocx works well in vc,but not in c#,the Microsoft .NET common
language runtime throw a System.ExecutionEngineException error message.msdn
said it is a bug of .NET and advice make sure not have any indirect module
dependencies.i do not know what it means,but i do need this ocx
control.what should i do?
pls tell me , thanks in advance and sorry for my poor english..
(A)i use the Visual Studio .NET 2003;
(B)the pci-ocx control is an data acquisition one,here is AxPci9812,it is
come with the data acquisition card (ADLINK PCI9812)i bought;
(C)the ocx control works well in VC.net;
(D)the program does not interupt at my break point,but the data acquisition
is complete and it is right compare to the VC code result ,but it throw an
ExecutionEngineException error,then my program interrupt.
(E)my code sets as follow;
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using AxMULTIPLELib;
using MULTIPLELib;
//using System.Windows.Forms.AxHost.AxMULTIPLELib ;

namespace _9812test
{
/// <summary>
/// Form1 µÄժҪ˵Ã÷¡£
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AxMULTIPLELib.AxPci9812 axPci98121;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
/// <summary>
/// ±ØÐèµÄÉè¼ÆÆ÷±äÁ¿¡£
/// </summary>
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Windows ´°ÌåÉè¼ÆÆ÷Ö§³ÖËù±ØÐèµÄ
//
InitializeComponent();
//
// TODO: ÔÚ InitializeComponent µ÷ÓúóÌí¼ÓÈκι¹Ô캯Êý´úÂë
//
}

/// <summary>
/// ÇåÀíËùÓÐÕýÔÚʹÓõÄ×ÊÔ´¡£
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows ´°ÌåÉè¼ÆÆ÷Éú³ÉµÄ´úÂë
/// <summary>
/// Éè¼ÆÆ÷Ö§³ÖËùÐèµÄ·½·¨ - ²»ÒªÊ¹ÓôúÂë±à¼*Æ÷ÐÞ¸Ä
/// ´Ë·½·¨µÄÄÚÈÝ¡£
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(Form1));
//this.axPci98121 = new AxMULTIPLELib.AxPci9812();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();

//((System.ComponentModel.ISupportInitialize)(this.a xPci98121)).BeginInit();
this.SuspendLayout();
//
// axPci98121
//
this.axPci98121.Enabled = true;
this.axPci98121.Location = new System.Drawing.Point(56, 392);
this.axPci98121.Name = "axPci98121";
this.axPci98121.OcxState =
((System.Windows.Forms.AxHost.State)(resources.Get Object("axPci98121.OcxStat
e")));
this.axPci98121.Size = new System.Drawing.Size(32, 32);
this.axPci98121.TabIndex = 2;
this.axPci98121.Visible = false;
this.axPci98121.AiHalfReady += new
AxMULTIPLELib._DPci9812Events_AiHalfReadyEventHand ler(this.axPci98121_AiHalf
Ready);
this.axPci98121.AiComplete += new
AxMULTIPLELib._DPci9812Events_AiCompleteEventHandl er(this.axPci98121_AiCompl
ete);
//
// button1
//
this.button1.Location = new System.Drawing.Point(224, 408);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(64, 16);
this.button1.TabIndex = 3;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(352, 392);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(112, 24);
this.label1.TabIndex = 5;
this.label1.Text = "label1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(536, 469);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
//this.Controls.Add(this.axPci98121);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.a xPci98121)).EndInit();
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// Ó¦ÓóÌÐòµÄÖ÷Èë¿Úµã¡£
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void Form1_Load(object sender, System.EventArgs e)
{
axPci98121.DeviceName="pci9812";
axPci98121.Open(0);
}

private void axPci98121_AiComplete(object sender,
AxMULTIPLELib._DPci9812Events_AiCompleteEvent e)
{
float[] scaledData=(float[])e.scaledData;
int k=scaledData.Length;
float[,] chandata=new float[4,(byte)(k/4)];
for(int i=0;i<(byte)(k/4);i++)
{
for(int j=0;j<3;j++)
{
chandata[i,j]=scaledData[4*i+j];
}

}

}

private void button1_Click(object sender, System.EventArgs e)
{
object filename=new object();
bool b=axPci98121.StartContAI("d:\\t.dat");//filename);

}

private void axPci98121_AiHalfReady(object sender,
AxMULTIPLELib._DPci9812Events_AiHalfReadyEvent e)
{
float[] scaledData=(float[])e.scaledData;
int k=scaledData.Length;
float[,] chandata=new float[4,(byte)(k/4)];
for(int i=0;i<(byte)(k/4);i++)
{
for(int j=0;j<3;j++)
{
chandata[i,j]=scaledData[4*i+j];
}

}
}
}
}
Nov 15 '05 #1
0 3228

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2069
by: Prasad | last post by:
We are invoking a SQL DTS component (lets call it Comp1) built by us in another component (Comp2).Comp1 was built by creating the DTS package using the SQL DTS wizard and then saving it as a VB...
0
1539
by: michael | last post by:
So I have a fairly large VB.Net application, lots of objects, lots of yucky OLEDB code. One day I started converting some Singles to Decimals because I wanted to make some calculations as precise...
1
4002
by: John O'Neill | last post by:
Hi I have been having a strange problem with a c# application I have been developing. My application detects when a Pocket PC device has been connected (via ActiveSyc) and queries the registry...
2
8320
by: Einar Værnes | last post by:
Hi I'm new to C#, and have just started to make a aspx-program. The program runs fine until i try to include a two-dimensional array: int myArray = new int {{1,2}, {3,4}, {5,6}, {7,8}}; The...
1
7106
by: Tim Mulholland | last post by:
I have an application that uses an external C(?) Dll and it seems like after I make a specific call to that dll the application will crash at a random call to the dll in the future. It sometimes...
1
387
by: Ladislav Prosek | last post by:
Hello, I have a managed class that I wrote in C++. When an exception (no matter which one) is thrown in its constructor, the program continues as expected but when it is about to exit (after...
8
1873
by: John | last post by:
Hi I am getting this error when running a project; An unhandled exception of type 'System.ExecutionEngineException' occurred in system.dll What can I do to fix this problem? Using vs.net...
3
3738
by: NormD | last post by:
An exception 'System.ExecutionEngineException' has occurred in servername I have deployed a windows application on a server; I'm running the same on my pc using...
3
11561
by: Stephen Flynn | last post by:
If I run my program on another machine I get the following error An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll This happens with I try to open an...
0
2215
by: selvialagar | last post by:
i've done a calibration tool. In that, there will be list of parameters and the value for the parameters are coming from the external device using TCP communication. The Screen will be refreshed once...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.