Click here to Skip to main content
15,887,746 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Accessing memory usage for current Application (or AppDomain)? Pin
je_gonzalez29-Dec-03 18:12
je_gonzalez29-Dec-03 18:12 
GeneralRe: Accessing memory usage for current Application (or AppDomain)? Pin
Jon Rista29-Dec-03 20:32
Jon Rista29-Dec-03 20:32 
QuestionIs it worth getting Visual C#? Pin
Gomac27-Dec-03 6:45
Gomac27-Dec-03 6:45 
AnswerRe: Is it worth getting Visual C#? Pin
Colin Angus Mackay27-Dec-03 7:11
Colin Angus Mackay27-Dec-03 7:11 
GeneralRe: Is it worth getting Visual C#? Pin
Gomac27-Dec-03 7:29
Gomac27-Dec-03 7:29 
AnswerRe: Is it worth getting Visual C#? Pin
SiddharthAtw29-Dec-03 22:33
SiddharthAtw29-Dec-03 22:33 
GeneralRe: Is it worth getting Visual C#? Pin
HAHAHA_NEXT8-Jan-04 9:51
HAHAHA_NEXT8-Jan-04 9:51 
QuestionBug in Forms.HelpProvider? Pin
Noodnik23-Dec-03 20:52
Noodnik23-Dec-03 20:52 
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( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Location = new System.Drawing.Point(184, 16);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "Cancel";
//
// button2
//
this.button2.Location = new System.Drawing.Point(184, 56);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "button2";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(24, 24);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 3;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(288, 122);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.button2,
this.button1});
this.HelpButton = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
AnswerRe: Bug in Forms.HelpProvider? Pin
je_gonzalez29-Dec-03 17:39
je_gonzalez29-Dec-03 17:39 
GeneralRe: Bug in Forms.HelpProvider? Pin
Noodnik2-Jan-04 8:01
Noodnik2-Jan-04 8:01 
Questionhow do i play an audio stream? Pin
godzooky23-Dec-03 5:18
godzooky23-Dec-03 5:18 
AnswerRe: how do i play an audio stream? Pin
eggie527-Dec-03 7:09
eggie527-Dec-03 7:09 
GeneralRe: how do i play an audio stream? Pin
godzooky6-Jan-04 4:17
godzooky6-Jan-04 4:17 
AnswerRe: how do i play an audio stream? Pin
Joseph Morin7-Jan-04 18:08
Joseph Morin7-Jan-04 18:08 
GeneralDeployment problem Pin
SaeidehV22-Dec-03 23:25
SaeidehV22-Dec-03 23:25 
GeneralRe: Deployment problem Pin
eggie527-Dec-03 7:13
eggie527-Dec-03 7:13 
GeneralRe: Deployment problem Pin
SaeidehV27-Dec-03 19:31
SaeidehV27-Dec-03 19:31 
GeneralObserved that the execution of the second request starts only when the processing of the first request is completed Pin
kandasamyg22-Dec-03 18:45
kandasamyg22-Dec-03 18:45 
GeneralRe: Observed that the execution of the second request starts only when the processing of the first request is completed Pin
Colin Angus Mackay22-Dec-03 23:31
Colin Angus Mackay22-Dec-03 23:31 
GeneralRe: Observed that the execution of the second request starts only when the processing of the first request is completed Pin
Ian Darling22-Dec-03 23:51
Ian Darling22-Dec-03 23:51 
GeneralRe: Observed that the execution of the second request starts only when the processing of the first request is completed Pin
hemrajs@bsil.com22-Dec-03 23:53
susshemrajs@bsil.com22-Dec-03 23:53 
GeneralRe: Observed that the execution of the second request starts only when the processing of the first request is completed Pin
Philip Fitzsimons23-Dec-03 4:31
Philip Fitzsimons23-Dec-03 4:31 
GeneralRe: Observed that the execution of the second request starts only when the processing of the first request is completed Pin
Richard Deeming9-Jan-04 7:25
mveRichard Deeming9-Jan-04 7:25 
GeneralHttpWebRequest problems Pin
SpaceWokker22-Dec-03 15:55
SpaceWokker22-Dec-03 15:55 
GeneralRe: HttpWebRequest problems Pin
SpaceWokker22-Dec-03 17:26
SpaceWokker22-Dec-03 17:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.