Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. TreeView Send Message Error

TreeView Send Message Error

Scheduled Pinned Locked Moved C#
helpdata-structuresdebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sameerhanda
    wrote on last edited by
    #1

    Ok,I have a generic Treeview component that I have inherited and it has the following error. When I try to click on the X on the control bar I get the following error: External component has thrown an exception. Here is the stack trace.. at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context).... I have traced this error to the SendMessage fuction i.e the following line [DllImport("user32.dll")] private static extern int SendMessage (IntPtr hWnd, int wMsg, IntPtr wParam,int lParam); If I comment this out in the code and all calls to this function it works fine. Any ideas on the correct fix for this. As always all help is appreciated. Sameer:^)

    D 1 Reply Last reply
    0
    • S sameerhanda

      Ok,I have a generic Treeview component that I have inherited and it has the following error. When I try to click on the X on the control bar I get the following error: External component has thrown an exception. Here is the stack trace.. at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context).... I have traced this error to the SendMessage fuction i.e the following line [DllImport("user32.dll")] private static extern int SendMessage (IntPtr hWnd, int wMsg, IntPtr wParam,int lParam); If I comment this out in the code and all calls to this function it works fine. Any ideas on the correct fix for this. As always all help is appreciated. Sameer:^)

      D Offline
      D Offline
      DigitalKing
      wrote on last edited by
      #2

      Try using this version of the function: [DllImport("user32.dll")] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups