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