1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

InkOverlay Handle Leak?

Discussion in 'Tablet PC' started by JasonG, Feb 22, 2005.

  1. JasonG

    JasonG Guest

    Hello,

    I have been encountering a problem lately while using the inkoverlay in
    a vb.net application. The gist of the problem is that my application
    has been creating handles out of control. I have been able to monitor
    this using the Performance Monitor tool with Windows XP (start->run
    perfmon.exe). If i monitor my application and view the Handle Count
    for my Process, I notice that it grows steadily and doesn't really
    reocver that fast. I was wondering if someone could look at my code
    snip and see if there is something that i am not disposing of

    To set up this application create a simple vb.net windows forms
    application and paste the following code into the form. (you also have
    to add a reference to microsoft.ink)

    Private WithEvents DrawingSurface As New InkOverlay
    Private MainGraphics As System.Drawing.Graphics

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    MainGraphics = Me.CreateGraphics

    DrawingSurface.Handle = Me.Handle
    DrawingSurface.AutoRedraw = True
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As
    System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    Dim newLoc As New Point(e.X, e.Y)
    DrawingSurface.Renderer.PixelToInkSpace(MainGraphics, newLoc)

    If Not DrawingSurface.Selection.Count = 0 AndAlso
    DrawingSurface.Selection.GetBoundingBox.Contains(newLoc.X, newLoc.Y)
    Then
    Me.ContextMenu = ContextMenu1
    Else
    Me.ContextMenu = ContextMenu2
    End If

    newLoc = Nothing
    End Sub

    Any help would be appreciated. Thanks in advance!
     
    JasonG, Feb 22, 2005
    #1
    1. Advertisements

  2. JasonG

    Chris H. Guest

    Jason, I'd suggest you post to the
    microsoft.public.windows.tabletpc.developer newsgroup. This newsgroup is
    for user support, while over there is for programmers and developers.
     
    Chris H., Feb 22, 2005
    #2
    1. Advertisements

  3. JasonG

    JasonG Guest

    Chris,

    Thanks for the input, I just posted in the Developer group.
     
    JasonG, Feb 22, 2005
    #3
  4. JasonG

    Chris H. Guest

    You'll get proper answers over there, Jason. We'd just be making bad
    guesses for the most part. :cool:
     
    Chris H., Feb 22, 2005
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.