Thanks for your responses. First of all, an apology. The line it crashes
on is not the ShowDialog() but the statement
CType(Me.Common Dialog1,
System.Componen tModel.ISupport Initialize).Beg inInit()
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.fmE dit.InitializeC omponent() Line 2748 + 0x24 bytes Basic
SCS.exe!scs.fmE dit.New() Line 23 + 0xb bytes Basic
SCS.exe!scs.fmE dit.get_DefInst ance() Line 2763 + 0x14 bytes Basic
SCS.exe!scs.Cue Editor.displayE dit(Integer pCuePtr = 1) Line 124 + 0x6
bytes Basic
SCS.exe!scs.fmM ain.btnEdit_Cli ck(Object eventSender =
{System.Windows .Forms.Button}, System.EventArg s eventArgs =
{System.EventAr gs}) Line 2225 + 0x9 bytes Basic
[<Non-user Code>]
SCS.exe!scs.frm Splash.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(B yVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles btnEdit.Click
Dim nCurrentCue As Integer
nCurrentCue = grdCues.Row ' grdCues is MSFlexGrid
displayEdit(nCu rrentCue)
fmEdit.DefInsta nce.ShowDialog( )
End Sub
The fmEdit New sub is as follows:
Public Sub New()
MyBase.New()
If m_vb6FormDefIns tance Is Nothing Then
If m_InitializingD efInstance Then
m_vb6FormDefIns tance = Me
Else
Try
'For the start-up form, the first instance created is the default
instance.
If
System.Reflecti on.Assembly.Get ExecutingAssemb ly.EntryPoint.D eclaringType Is
Me.GetType Then
m_vb6FormDefIns tance = Me
End If
Catch
End Try
End If
End If
'This call is required by the Windows Form Designer.
InitializeCompo nent()
End Sub
The InitializeCompo nent is 2560 lines long, starting with:
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.components = New System.Componen tModel.Containe r
Dim resources As System.Resource s.ResourceManag er = New
System.Resource s.ResourceManag er(GetType(fmEd it))
and the line it actually crashes on is:
CType(Me.Common Dialog1,
System.Componen tModel.ISupport Initialize).Beg inInit()
which is about 150 lines into InitializeCompo nent.
Earlier in the code (earlier than the start of InitializeCompo nent) is:
Me.CommonDialog 1 = New AxMSComDlg.AxCo mmonDialog
I appreciate your help, everyone.
Regards,
Mike