473,385 Members | 1,359 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,385 software developers and data experts.

executionengineexception in forms.dll

MD
I have been converting a program from VB6 to VB.Net and enhancing it as
well. All has been progressing OK although its been hard work. Now, all of
a sudden, when I try to execute a ShowDialog() on one of my forms I get "An
unhandled exception of type 'System.ExecutionEngineException' occurred in
system.windows.forms.dll".

I can't work out what has caused this, and can't find any help on the
Microsoft site or anywhere else on the web. Can anyone help?

Thanks,
Mike
Nov 20 '05 #1
13 5529
Hi MD,

|| Can anyone help?

Maybe, he says tentatively. ;-)

You'll need to show us the code - where it's called and the New and Load
of the dialogue..

Regards,
Fergus
Nov 20 '05 #2
"MD" <me@here.com> schrieb
I have been converting a program from VB6 to VB.Net and enhancing it
as well. All has been progressing OK although its been hard work.
Now, all of a sudden, when I try to execute a ShowDialog() on one of
my forms I get "An unhandled exception of type
'System.ExecutionEngineException' occurred in
system.windows.forms.dll".

I can't work out what has caused this, and can't find any help on
the Microsoft site or anywhere else on the web. Can anyone help?


Please post the callstack when the execption occurs.
--
Armin

Nov 20 '05 #3
"MD" <me@here.com> scripsit:
I have been converting a program from VB6 to VB.Net and enhancing it as
well. All has been progressing OK although its been hard work. Now, all of
a sudden, when I try to execute a ShowDialog() on one of my forms I get "An
unhandled exception of type 'System.ExecutionEngineException' occurred in
system.windows.forms.dll".

I can't work out what has caused this, and can't find any help on the
Microsoft site or anywhere else on the web. Can anyone help?


That's a really bad exception. Do you use any ActiveX controls or the
controls from the Visual Basic Compatibility Library on the
form?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
MD
Thanks for your responses. First of all, an apology. The line it crashes
on is not the ShowDialog() but the statement
CType(Me.CommonDialog1,
System.ComponentModel.ISupportInitialize).BeginIni t()
which is issued during the processing of ShowDialog(). I thought it was the
ShowDialog() but that was when it occurred if I commented out the real
culprit. Here's some more info you requested:

Armin: the stack contains this:
[<Non-user Code>]
SCS.exe!scs.fmEdit.InitializeComponent() Line 2748 + 0x24 bytes Basic

SCS.exe!scs.fmEdit.New() Line 23 + 0xb bytes Basic
SCS.exe!scs.fmEdit.get_DefInstance() Line 2763 + 0x14 bytes Basic
SCS.exe!scs.CueEditor.displayEdit(Integer pCuePtr = 1) Line 124 + 0x6
bytes Basic
SCS.exe!scs.fmMain.btnEdit_Click(Object eventSender =
{System.Windows.Forms.Button}, System.EventArgs eventArgs =
{System.EventArgs}) Line 2225 + 0x9 bytes Basic
[<Non-user Code>]
SCS.exe!scs.frmSplash.Main() Line 5 + 0x1d bytes Basic

Herfried: I'm not sure how to identify an ActiveX control, but there are
some VB6 controls that I do still use. In the references section I have
some Ax... references, so I guess these are the ActiveX controls. The Ax...
references shown are AxMSComCtl2, AxMSComctlLib, AxMSComDlg,
AxMSFlexGridLib, AxRichTextLib. There are also references to these same
names without the Ax, eg MSComCtl2, etc. Does this mean I still have a lot
of VB6 baggage hanging around? I'd like to keep the FlexGrid as it seems to
me to be a major job to convert this to a DataGrid, but if I should be
converting any of the other controls to VB.Net equivalents then I will.

Fergus: The ShowDialog() is called by clicking a button from my main form,
which executes this:

Private Sub btnEdit_Click(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArgs) Handles btnEdit.Click
Dim nCurrentCue As Integer
nCurrentCue = grdCues.Row ' grdCues is MSFlexGrid
displayEdit(nCurrentCue)
fmEdit.DefInstance.ShowDialog()
End Sub

The fmEdit New sub is as follows:
Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
If m_InitializingDefInstance Then
m_vb6FormDefInstance = Me
Else
Try
'For the start-up form, the first instance created is the default
instance.
If
System.Reflection.Assembly.GetExecutingAssembly.En tryPoint.DeclaringType Is
Me.GetType Then
m_vb6FormDefInstance = Me
End If
Catch
End Try
End If
End If
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub

The InitializeComponent is 2560 lines long, starting with:
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(fmEdit))

and the line it actually crashes on is:
CType(Me.CommonDialog1,
System.ComponentModel.ISupportInitialize).BeginIni t()
which is about 150 lines into InitializeComponent.

Earlier in the code (earlier than the start of InitializeComponent) is:
Me.CommonDialog1 = New AxMSComDlg.AxCommonDialog

I appreciate your help, everyone.

Regards,
Mike
Nov 20 '05 #5
"MD" <me@here.com> schrieb
Thanks for your responses. First of all, an apology. The line it
crashes on is not the ShowDialog() but the statement
CType(Me.CommonDialog1,
System.ComponentModel.ISupportInitialize).BeginIni t()
which is issued during the processing of ShowDialog(). I thought it
was the ShowDialog() but that was when it occurred if I commented out
the real culprit. Here's some more info you requested:

Armin: the stack contains this:
[<Non-user Code>]
SCS.exe!scs.fmEdit.InitializeComponent() Line 2748 + 0x24 bytes Basic SCS.exe!scs.fmEdit.New() Line 23 + 0xb bytes Basic
SCS.exe!scs.fmEdit.get_DefInstance() Line 2763 + 0x14 bytes
Basic SCS.exe!scs.CueEditor.displayEdit(Integer pCuePtr = 1) Line 124
+ 0x6 bytes Basic
SCS.exe!scs.fmMain.btnEdit_Click(Object eventSender =
{System.Windows.Forms.Button}, System.EventArgs eventArgs =
{System.EventArgs}) Line 2225 + 0x9 bytes Basic
[<Non-user Code>]
SCS.exe!scs.frmSplash.Main() Line 5 + 0x1d bytes Basic

Could you please expand the "non-user code" (by right-clicking in the
callstack window and select "expand non-user code" (or similar)) when the
exception occurs and post it again? As you wrote below, it must be somewhere
in ISupportInitialize.BeginInit, so the error might be hard to find.

The InitializeComponent is 2560 lines long, starting with:
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(fmEdit))

and the line it actually crashes on is:
CType(Me.CommonDialog1,
System.ComponentModel.ISupportInitialize).BeginIni t()
which is about 150 lines into InitializeComponent. Earlier in the code (earlier than the start of InitializeComponent)
is:
Me.CommonDialog1 = New AxMSComDlg.AxCommonDialog


Earlier? Before Sub InitializeComponent is called? Hard to imagine because
there should only be the "If m_vb6FormDefInstance Is Nothing..." stuff. The
assignment "Me.CommonDialog1 = ..." should be _within_ Initializecomponent.

--
Armin

Nov 20 '05 #6
Hi Mike,

At this stage it's of no use to you other than interest, but there's
another on-going query regarding a program that crashes at the EndInit() of
ISupportInitialize. This time it's in association with an AxBrowser control.

Regards,
Fergus
Nov 20 '05 #7
Cor
Fergus,
Which one is it?
Cor
Nov 20 '05 #8
Good morning Cor,

I usually give the topic but I left it out this time because it's very
long (30 messages) and the bulk of it is on a different issue. The "BANG!,
zip, pop and whirr" problem only arises in the last few messages when the
first issue had been thoroughly [but :-(( unsuccesfully] explored.

The topic is: Strange? DesignMode Behaviour, dated 19th Sep, 11:00am

Regards,
Fergus
Nov 20 '05 #9
Cor
Good morning Fergus,

I got the idea already that it had to do with Charles
I did give a small answer to Charles in the other thread.
It is something I always have to think on when I have those problems with
the webbrowser but never did investigation in.

Cor
Nov 20 '05 #10
MD
<<snipped>>
Armin: the stack contains this:
[<Non-user Code>]
SCS.exe!scs.fmEdit.InitializeComponent() Line 2748 + 0x24 bytes Basic SCS.exe!scs.fmEdit.New() Line 23 + 0xb bytes Basic
SCS.exe!scs.fmEdit.get_DefInstance() Line 2763 + 0x14 bytes
Basic SCS.exe!scs.CueEditor.displayEdit(Integer pCuePtr = 1) Line 124
+ 0x6 bytes Basic
SCS.exe!scs.fmMain.btnEdit_Click(Object eventSender =
{System.Windows.Forms.Button}, System.EventArgs eventArgs =
{System.EventArgs}) Line 2225 + 0x9 bytes Basic
[<Non-user Code>]
SCS.exe!scs.frmSplash.Main() Line 5 + 0x1d bytes Basic

Could you please expand the "non-user code" (by right-clicking in the
callstack window and select "expand non-user code" (or similar)) when the
exception occurs and post it again? As you wrote below, it must be

somewhere in ISupportInitialize.BeginInit, so the error might be hard to find.

Here it is:
system.windows.forms.dll!System.Windows.Forms.AxHo st.ConnectionPointCookie.C
onnectionPointCookie(System.Object source = {System.__ComObject},
System.Object sink = {AxMSComDlg.AxCommonDialogEventMulticaster},
System.Type eventInterface = {"MSComDlg.ICommonDialogEvents"}) + 0x1d4 bytes
axinterop.mscomdlg.dll!AxMSComDlg.AxCommonDialog.C reateSink() + 0x78 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.StartEvents() + 0x45
bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.TransitionUpTo(int
state = 2) + 0xf5 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.CreateHandle() + 0x24
bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl(bool
fIgnoreVisible = true) + 0xdd bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl(bool
fIgnoreVisible = true) + 0x1c2 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.EndInit() + 0x32
bytes SCS.exe!scs.fmEdit.InitializeComponent() Line 2750 + 0x24 bytes Basic SCS.exe!scs.fmEdit.New() Line 23 + 0xb bytes Basic
SCS.exe!scs.fmEdit.get_DefInstance() Line 2765 + 0x14 bytes Basic
SCS.exe!scs.CueEditor.displayEdit(Integer pCuePtr = 1) Line 124 + 0x6
bytes Basic
SCS.exe!scs.fmMain.btnEdit_Click(Object eventSender =
{System.Windows.Forms.Button}, System.EventArgs eventArgs =
{System.EventArgs}) Line 2225 + 0x9 bytes Basic

system.windows.forms.dll!System.Windows.Forms.Cont rol.OnClick(System.EventAr
gs e = {System.EventArgs}) + 0x5e bytes

system.windows.forms.dll!System.Windows.Forms.Butt on.OnClick(System.EventArg
s e = {System.EventArgs}) + 0x33 bytes

system.windows.forms.dll!System.Windows.Forms.Butt on.OnMouseUp(System.Window
s.Forms.MouseEventArgs mevent = {X=25 Y=13 Button=Left}) + 0x133 bytes

system.windows.forms.dll!System.Windows.Forms.Cont rol.WmMouseUp(System.Windo
ws.Forms.Message m = {System.Windows.Forms.Message},
System.Windows.Forms.MouseButtons button = Left, int clicks = 1) + 0x261
bytes

system.windows.forms.dll!System.Windows.Forms.Cont rol.WndProc(System.Windows
..Forms.Message m = {System.Windows.Forms.Message}) + 0x49b bytes

system.windows.forms.dll!System.Windows.Forms.Butt onBase.WndProc(System.Wind
ows.Forms.Message m = {System.Windows.Forms.Message}) + 0x121 bytes

system.windows.forms.dll!System.Windows.Forms.Butt on.WndProc(System.Windows.
Forms.Message m = {System.Windows.Forms.Message}) + 0x85 bytes

system.windows.forms.dll!ControlNativeWindow.OnMes sage(System.Windows.Forms.
Message m = {System.Windows.Forms.Message}) + 0x13 bytes

system.windows.forms.dll!ControlNativeWindow.WndPr oc(System.Windows.Forms.Me
ssage m = {System.Windows.Forms.Message}) + 0xda bytes

system.windows.forms.dll!System.Windows.Forms.Nati veWindow.DebuggableCallbac
k(int hWnd = 198514, int msg = 514, int wparam = 0, int lparam = 851993) +
0x3d bytes

system.windows.forms.dll!System.Windows.Forms.Appl ication.ComponentManager.S
ystem.Windows.Forms.UnsafeNativeMethods+IMsoCompon entManager.FPushMessageLoo
p(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes
system.windows.forms.dll!ThreadContext.RunMessageL oopInner(int reason
= -1, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes
system.windows.forms.dll!ThreadContext.RunMessageL oop(int reason = -1,
System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes

system.windows.forms.dll!System.Windows.Forms.Appl ication.Run(System.Windows
..Forms.Form mainForm = {scs.frmSplash}) + 0x34 bytes
SCS.exe!scs.frmSplash.Main() Line 5 + 0x1d bytes Basic
The InitializeComponent is 2560 lines long, starting with:
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(fmEdit))

and the line it actually crashes on is:
CType(Me.CommonDialog1,
System.ComponentModel.ISupportInitialize).BeginIni t()
which is about 150 lines into InitializeComponent.
Earlier in the code (earlier than the start of InitializeComponent)
is:
Me.CommonDialog1 = New AxMSComDlg.AxCommonDialog


Earlier? Before Sub InitializeComponent is called? Hard to imagine because
there should only be the "If m_vb6FormDefInstance Is Nothing..." stuff.

The assignment "Me.CommonDialog1 = ..." should be _within_ Initializecomponent.


Yes, you're right. I got confused with all the code that is present.
"Me.CommonDialog1 = New AxMSComDlg.AxCommonDialog" IS within
InitializeComponent. The reference to CommonDialog1 that was before the
start of InitializeComponent is:

Public WithEvents CommonDialog1 As AxMSComDlg.AxCommonDialog

Mike
Nov 20 '05 #11
MD
Thanks Fergus - I'll have a look at that thread.

Regards,
Mike

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
Hi Mike,

At this stage it's of no use to you other than interest, but there's
another on-going query regarding a program that crashes at the EndInit() of ISupportInitialize. This time it's in association with an AxBrowser control.
Regards,
Fergus

Nov 20 '05 #12
MD
Thanks for your help, everyone. I have fixed the problem by replacing the
CommonDialog with OpenFileDialog. It would have taken me ages to sort that
out without the suggestions and ideas put forward by you guys.

Regards,
Mike
Nov 20 '05 #13
"MD" <me@here.com> schrieb

I thought I've already given you an answer, but now I see I didn't send it.
"More" see below. Meanwhile you found an alternative, so simply ignore me.
;-)
system.windows.forms.dll!System.Windows.Forms.AxHo st.ConnectionPointCookie.C onnectionPointCookie(System.Object source = {System.__ComObject},
System.Object sink = {AxMSComDlg.AxCommonDialogEventMulticaster},
System.Type eventInterface = {"MSComDlg.ICommonDialogEvents"}) +
0x1d4 bytes
axinterop.mscomdlg.dll!AxMSComDlg.AxCommonDialog.C reateSink() +
0x78 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.StartEvents() +
0x45 bytes

system.windows.forms.dll!System.Windows.Forms.AxHo st.TransitionUpTo(int
state = 2) + 0xf5 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.CreateHandle()
+ 0x24
bytes

system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl(bool
fIgnoreVisible = true) + 0xdd bytes

system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl(bool
fIgnoreVisible = true) + 0x1c2 bytes
system.windows.forms.dll!System.Windows.Forms.AxHo st.EndInit() +
0x32
bytes

The line above says that the error occurs in "EndInit". In your previous
posting you wrote that the error occurs in BeginInit.
Anyway, unfortunately I can't figure out why it is like it is. :-(
--
Armin

Nov 20 '05 #14

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

Similar topics

6
by: Magnus Ullberg | last post by:
How do i convert the following structure declaration from c++ to c#? #pragma pack(push,1) //Byte alignment struct TtsrPlayerInfo { int PlayerID; int ChannelID; char NickName; int...
0
by: BeeFirst | last post by:
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...
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...
2
by: TT (Tom Tempelaere) | last post by:
Hi people, In my code I get an ExecutionEngineException. I don't know what to do with it, and I can't seem to get rid of it. How can I figure out what is causing it? It always appears on the...
14
by: TT (Tom Tempelaere) | last post by:
Hi people, The code that follows throws an ExecutionEngineException. This was written in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1 (7.1.3088). The framework is .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...
0
by: sagar.jawale | last post by:
Hi, In my c# windows application, i am using AxSHDocVw.AxWebBrowser. I am displaying a generated receipt html in this browser. Also, for printing the same html, i am using the following command...
2
by: Fredo | last post by:
I'm going to try to post this without having to paste in hundreds of lines of code. I'm trying to override IInternetSecurityManager. I'm taking sort of a minimalist approach and adding code as I...
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.