By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,685 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,685 IT Pros & Developers. It's quick & easy.

executionengineexception in forms.dll

P: n/a
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
Share this Question
Share on Google+
13 Replies


P: n/a
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

P: n/a
"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

P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
Cor
Fergus,
Which one is it?
Cor
Nov 20 '05 #8

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.