hi developers, i have the next problem, i'm migrating an application from vb6 to c# .net, the situation is that i have a form and when i try to move from this form to another window with ctrl-tab occurs this error, i've been reviewing the calls to pinvokes signatures, but the signatures calls on the code is never executed when i do the process, the stack trace give me that at the top
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
in the code don't have any signature that matches with the marked in the stack trace
when i catch this error the message says,
A form that is already visible can not be displayed as a dialog modal form, set the form's visible property to false before calling ShowDialog
i tried to manage this in some events like "activate" but i can't get the solution.
****************************************************************************************
this is the complete stack trace if can help
StackTrace: |
en System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) |
en System.Windows.Forms.NativeWindow.DefWndProc(Message& m) |
en System.Windows.Forms.ToolTip.WndProc(Message& msg) |
en System.Windows.Forms.ToolTip.ToolTipNativeWindow.WndProc(Message& m) |
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) |
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) |
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) |
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) |
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) |
en System.Windows.Forms.Application.RunDialog(Form form) |
en System.Windows.Forms.Form.ShowDialog(IWin32Window owner) |
en System.Windows.Forms.Form.ShowDialog() |
en C12Shares.frm_Registro.cmd_iniciar_Click(Object eventSender, EventArgs eventArgs) en FrmRegistro.cs:línea 287 |
en C12Shares.frm_Registro.frm_Registro_Load(Object eventSender, EventArgs eventArgs) en FrmRegistro.cs:línea 517 |
en System.Windows.Forms.Form.OnLoad(EventArgs e) |
en System.Windows.Forms.Form.OnCreateControl() |
en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) |
en System.Windows.Forms.Control.CreateControl() |
en System.Windows.Forms.Control.WmShowWindow(Message& m) |
en System.Windows.Forms.Control.WndProc(Message& m) |
en System.Windows.Forms.ScrollableControl.WndProc(Message& m) |
en System.Windows.Forms.Form.WmShowWindow(Message& m) |
en System.Windows.Forms.Form.WndProc(Message& m) |
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) |
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) |
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) |
en System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam) |
en System.Windows.Forms.Form.SetVisibleCore(Boolean value) |
en System.Windows.Forms.Control.set_Visible(Boolean value) |
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) |
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) |
en System.Windows.Forms.Application.Run(Form mainForm) |
en C12Shares.frm_Registro.Main() en FrmRegistro.cs:línea 640 |
en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) |
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) |
en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() |
en System.Threading.ThreadHelper.ThreadStart_Context(Object state) |
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) |
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) |
en System.Threading.ThreadHelper.ThreadStart() **************************************************************************************** i tried too making this configuration Tools -> Options -> Debug ->suppress jit optimization on module load but it neither Works, the same error again is launched i hope someone can help me. Regards !! |