Armin: the stack contains this:
[ said:
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.AxHost.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.CreateSink() + 0x78 bytes
system.windows.forms.dll!System.Windows.Forms.AxHost.StartEvents() + 0x45
bytes
system.windows.forms.dll!System.Windows.Forms.AxHost.TransitionUpTo(int
state = 2) + 0xf5 bytes
system.windows.forms.dll!System.Windows.Forms.AxHost.CreateHandle() + 0x24
bytes
system.windows.forms.dll!System.Windows.Forms.Control.CreateControl(bool
fIgnoreVisible = true) + 0xdd bytes
system.windows.forms.dll!System.Windows.Forms.Control.CreateControl(bool
fIgnoreVisible = true) + 0x1c2 bytes
system.windows.forms.dll!System.Windows.Forms.AxHost.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.Control.OnClick(System.EventAr
gs e = {System.EventArgs}) + 0x5e bytes
system.windows.forms.dll!System.Windows.Forms.Button.OnClick(System.EventArg
s e = {System.EventArgs}) + 0x33 bytes
system.windows.forms.dll!System.Windows.Forms.Button.OnMouseUp(System.Window
s.Forms.MouseEventArgs mevent = {X=25 Y=13 Button=Left}) + 0x133 bytes
system.windows.forms.dll!System.Windows.Forms.Control.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.Control.WndProc(System.Windows
..Forms.Message m = {System.Windows.Forms.Message}) + 0x49b bytes
system.windows.forms.dll!System.Windows.Forms.ButtonBase.WndProc(System.Wind
ows.Forms.Message m = {System.Windows.Forms.Message}) + 0x121 bytes
system.windows.forms.dll!System.Windows.Forms.Button.WndProc(System.Windows.
Forms.Message m = {System.Windows.Forms.Message}) + 0x85 bytes
system.windows.forms.dll!ControlNativeWindow.OnMessage(System.Windows.Forms.
Message m = {System.Windows.Forms.Message}) + 0x13 bytes
system.windows.forms.dll!ControlNativeWindow.WndProc(System.Windows.Forms.Me
ssage m = {System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallbac
k(int hWnd = 198514, int msg = 514, int wparam = 0, int lparam = 851993) +
0x3d bytes
system.windows.forms.dll!System.Windows.Forms.Application.ComponentManager.S
ystem.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoo
p(int dwComponentID = 1, int reason = -1, int pvLoopData = 0) + 0x349 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason
= -1, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x1f3 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason = -1,
System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes
system.windows.forms.dll!System.Windows.Forms.Application.Run(System.Windows
..Forms.Form mainForm = {scs.frmSplash}) + 0x34 bytes
SCS.exe!scs.frmSplash.Main() Line 5 + 0x1d bytes Basic
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