|
-
Feb 5th, 2023, 02:31 PM
#34
Re: VB6 - MouseWheel with Any Control (originally just MSFlexGrid Scrolling)
 Originally Posted by VanGoghGaming
If you really want to experience the crash yourself, it's very easy to replicate. Slap a "Microsoft InkEdit Control" on a form, subclass it with your favorite method, don't even need to write any additional code, press F5 to run the project, close the form, the IDE will crash. To avoid the crash, unsubclass it explicitly.
Just because unsubclassing on "WM_DESTROY" works for most controls doesn't mean it's a good practice but to each his own I guess...
I did spend a bit of time looking at the InkEdit control, and apparently it doesn't issue a DestroyWindow call when the form it's on is destroyed. IMO, that's a bug in the InkEdit control, and a possible memory leak. I Googled, and apparently there some degree of discussion about this bug in the InkEdit control. Furthermore, this is the first time I've seen such a bug in a user control (as destroying any created hWnd is sort of a "first order of business" when writing such controls).
----------
So, a couple of thoughts:
1) I don't see a reason to generally change my style of subclassing because of a bug in one specific control. I've never used the InkEdit control, but, if I ever do, and I also wish to subclass it, I'll try and remember this.
2) We're getting pretty far afield from the subject of this thread. So, if you (or anyone) wishes to discuss this further, I'd recommend starting a new thread over in the regular Q&A area.
Last edited by Shaggy Hiker; Feb 5th, 2023 at 10:48 PM.
Reason: Cleaned up after the other post was cleaned.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|