473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 3203

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

Similar topics

0
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
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
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
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
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
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
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
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
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
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.