Bug in Forms.HelpProvider?
-
I'm trying to provide simple "pop-up" (e.g., tooltip-style) help hints for my dialog controls (standard Windows Forms using C#), using System.Windows.Forms.HelpProvider and System.Windows.Forms.Form.HelpButton. I'm using only the "SetHelpString()" method on the HelpProvider to set the help text to strings managed internally by the application. When I invoke the help the first time, it always seems to work. Sufficient subsequent invocations invariably either crash the program completely (with an "Application Error" dialog: The instruction at "xxxxx" referenced memory at "xxxxx". The memory could not be "written". Click on OK to terminate the program - sometimes it says "read" instead of "written") or cause some very strange application error/exception that the CLR does manage to catch. Does anyone recognize this? Is there a fix for it? I've searched MSDN Knowledge Base and Google (and here at CodeProject) for clues, but nothing comes up. Help!! Here's a program that demonstrates this problem for me, usually within 5-10 usages of the "HelpButton": ----------------------- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace WindowsApplication1 { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.HelpProvider helpProvider1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.TextBox textBox1; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); string s= "This is the help for button 1 I hope it is long and helps us to figure out where the problem is" ; helpProvider1.SetHelpString(button1, s) ; s= "This is the help for button 2 I hope it is long and helps us to figure out where the problem is" ; helpProvider1.SetHelpString(button2, s) ; s= "And this help is for the text box" ; helpProvider1.SetHelpString(textBox1, s) ; } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( di
-
I'm trying to provide simple "pop-up" (e.g., tooltip-style) help hints for my dialog controls (standard Windows Forms using C#), using System.Windows.Forms.HelpProvider and System.Windows.Forms.Form.HelpButton. I'm using only the "SetHelpString()" method on the HelpProvider to set the help text to strings managed internally by the application. When I invoke the help the first time, it always seems to work. Sufficient subsequent invocations invariably either crash the program completely (with an "Application Error" dialog: The instruction at "xxxxx" referenced memory at "xxxxx". The memory could not be "written". Click on OK to terminate the program - sometimes it says "read" instead of "written") or cause some very strange application error/exception that the CLR does manage to catch. Does anyone recognize this? Is there a fix for it? I've searched MSDN Knowledge Base and Google (and here at CodeProject) for clues, but nothing comes up. Help!! Here's a program that demonstrates this problem for me, usually within 5-10 usages of the "HelpButton": ----------------------- using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace WindowsApplication1 { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.HelpProvider helpProvider1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.TextBox textBox1; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); string s= "This is the help for button 1 I hope it is long and helps us to figure out where the problem is" ; helpProvider1.SetHelpString(button1, s) ; s= "This is the help for button 2 I hope it is long and helps us to figure out where the problem is" ; helpProvider1.SetHelpString(button2, s) ; s= "And this help is for the text box" ; helpProvider1.SetHelpString(textBox1, s) ; } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( di
Your problem is not with the code attached. At least I do not get the error after 35 tries (.NET 1.1.4322)
-
Your problem is not with the code attached. At least I do not get the error after 35 tries (.NET 1.1.4322)
Thanks for checking that out! In "Help:About" from my "Visual C# .NET" IDE, I see I'm using "Microsoft .NET Framework Version 1.0.3705" (e.g., a very old version). It would appear to be a bug that has been fixed in updates to the .NET framework and/or the IDE. Do you know where I can get the update(s) for my .NET Framework and IDE? I've tried the "Check for Updates" menu item (it fails without giving a reason), and looked around Microsoft's Support website for updates, but am not sure what I need.