Search Results

Search found 3 results on 1 pages for 'bahgat mashaly'.

Page 1/1 | 1 

  • problem disposing class in Dictionary it is Still in the heap memory although using GC.Collect

    - by Bahgat Mashaly
    Hello i have a problem disposing class in Dictionary this is my code private Dictionary<string, MyProcessor> Processors = new Dictionary<string, MyProcessor>(); private void button1_Click(object sender, EventArgs e) { if (!Processors.ContainsKey(textBox1.Text)) { Processors.Add(textBox1.Text, new MyProcessor()); } } private void button2_Click(object sender, EventArgs e) { MyProcessor currnt_processor = Processors[textBox1.Text]; Processors.Remove(textBox2.Text); currnt_processor.Dispose(); currnt_processor = null; GC.Collect(); } public class MyProcessor: IDisposable { private bool isDisposed = false; string x = ""; public MyProcessor() { for (int i = 0; i < 20000; i++) { //this line only to increase the memory usage to know if the class is dispose or not x = x + "gggggggggggg"; } this.Dispose(); GC.SuppressFinalize(this); } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } public void Dispose(bool disposing) { if (!this.isDisposed) { isDisposed = true; this.Dispose(); } } ~MyProcessor() { Dispose(false); } } i use "ANTS Memory Profiler" to monitor heap memory the disposing work only when i remove all keys from dictionary how can i destroy the class from heap memory ? thanks in advance

    Read the article

  • problem convert idl to tbl

    - by Bahgat Mashaly
    i try to get a selected text and the word under mouse in firefox after a lot of search i get the solution that i must access a document's HTML in Firefox using IAccessible i found that solution in c++ in this link How to access a document's HTML in Firefox using IAccessible the solution use ISimpleDOMNode.idl file so the first step to convert that solution from c++ to c# is convert ISimpleDOMNode.idl to tlb file and convert tlb to dll fill i try to use VS Command Prompt with this command to convert to tlb file midl ISimpleDOMNode.idl but That generate ISimpleDOMNode.h and ISimpleDOMDocument.h, which define the interfaces. It also create ISimpleDOMNode_i.c and ISimpleDOMDocument_i.c but there is no tlb file what is the wrong ?

    Read the article

  • can i get the font information from Graphics System.Drawing.Graphics in c#

    - by Bahgat Mashaly
    Hello i get the Graphics from Graphics g= System.Drawing.Graphics.FromHwnd(button1.Handle); can i get the font information from this Graphics i was try to get a font by using GetTextFace api function but it return "system" it mean default font in OS and i was try to use SendMessage(button1.Handle, WM_GETFONT, 0, 0); bu it return me 0 also it is mean default font in OS I have known the cause of the problem, it due to FlatStyle property See this link http://blogs.msdn.com/b/michkap/archive/2008/09/26/8965526.aspx thanks

    Read the article

1