Poltergeists?

A

Alex

Am I going crazy?

In my Word COM add-in (in C#), I present a Windows Form. There, I have a radio buttons on a tab page that somehow gets a click sent to it when I switch tabs, even though I didn't click it.

This messes up the application.

Please help!


The call stack shows:

system.windows.forms.dll!System.Windows.Forms.RadioButton.OnCheckedChanged(e = {System.EventArgs})
system.windows.forms.dll!System.Windows.Forms.RadioButton.set_Checked(value = true)
system.windows.forms.dll!System.Windows.Forms.RadioButton.OnClick(e = {System.EventArgs})
system.windows.forms.dll!System.Windows.Forms.ButtonBase.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.OnMessage(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(hWnd = 2427722, msg = 8465, wparam = 2890, lparam = 2427722)
USER32.DLL!GetTopWindow()
USER32.DLL!DefWindowProcW()
USER32.DLL!DefWindowProcW()
NTDLL.DLL!KiUserCallbackDispatcher()
USER32.DLL!SendMessageW()
system.windows.forms.dll!System.Windows.Forms.Control.SendMessage(msg = 8465, wparam = 2890, lparam = 2427722)
system.windows.forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(hWnd = 2427722, m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Control.WmCommand(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Control.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.ScrollableControl.WndProc(m= {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.OnMessage(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(hWnd = 3540184, msg = 273, wparam = 2890, lparam = 2427722)
USER32.DLL!GetTopWindow()
USER32.DLL!DefWindowProcW()
USER32.DLL!DefWindowProcW()
NTDLL.DLL!KiUserCallbackDispatcher()
USER32.DLL!SendMessageW()
USER32.DLL!SetCapture()
USER32.DLL!IsDialogMessageW()
USER32.DLL!GetTopWindow()
USER32.DLL!VkKeyScanW()
USER32.DLL!CallWindowProcW()
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Control.DefWndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Control.WmSetFocus(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Control.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.ButtonBase.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.OnMessage(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(hWnd = 2427722, msg = 7, wparam = 8063466, lparam = 0)
USER32.DLL!GetTopWindow()
USER32.DLL!DefWindowProcW()
USER32.DLL!DefWindowProcW()
system.windows.forms.dll!System.Windows.Forms.ContainerControl.FocusActiveControlInternal()
system.windows.forms.dll!System.Windows.Forms.Form.set_Active(value = true)
system.windows.forms.dll!System.Windows.Forms.Form.WmActivate(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.Form.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.OnMessage(m = {System.Windows.Forms.Message})
system.windows.forms.dll!ControlNativeWindow.WndProc(m = {System.Windows.Forms.Message})
system.windows.forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(hWnd = 2820610, msg = 6, wparam = 2, lparam = 6227952)
USER32.DLL!GetTopWindow()
USER32.DLL!DefWindowProcW()
USER32.DLL!DefWindowProcW()
NTDLL.DLL!KiUserCallbackDispatcher()
USER32.DLL!SetWindowLongA()
WINWORD.EXE!300d2e47()
WINWORD.EXE!300687eb()
WINWORD.EXE!300687ad()
WINWORD.EXE!30069eb2()
WINWORD.EXE!300681b1()
WINWORD.EXE!30003abb()
 
P

Peter Huang [MSFT]

Hi Alex,

Based on my test I can not reproduce the problem.
Here is my reproduce code.
[1 Show a Form]
public void OnConnection(object application,
Extensibility.ext_ConnectMode connectMode, object addInInst, ref
System.Array custom)
{
applicationObject = application;
addInInstance = addInInst;
Form_Tab ft = new Form_Tab();
ft.Show();
}

[2 on the form I have two tab page, each have a radiobutton, and handle
then as below.
private void radioButton1_CheckedChanged(object sender, System.EventArgs
e)
{
System.Diagnostics.Debug.WriteLine("radioButton1_CheckedChanged");
}

private void radioButton2_CheckedChanged(object sender, System.EventArgs
e)
{
System.Diagnostics.Debug.WriteLine("radioButton2_CheckedChanged");
}

[3 run the winword and the form will invoke, but the two checkedchanged
will not fire when I switch the tabpage.
It will fire only when I click on the radiobutton to change the check state.

You may have a try.
Also can you provide a reproduce sample together with the reproduce steps
to me.
You may reach me via removing the "online" from my email address.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top