|
-
Jan 21st, 2018, 04:05 AM
#1
Thread Starter
Junior Member
IDE crashing after running a program with subclassing
I have a VB6 program that uses subclassing. As a compiled exe it works fine.
If I run it within the VB IDE it also works fine, but on closing the program the IDE crashes, sometimes immediately and sometimes after a minute or two. I know that I can’t use things like STOP, END, Break, etc within the IDE as these always crashes the IDE, but this is not the problem. The program is closed in the correct way.
This means that each time make any modifications to the program I have to compile it, and then run the exe to test the modifications.
This can get quite laborious....
The subclassed windows are correctly released when the program closes, so at this point there is no longer any subclassing active.
Has anyone any ideas as to why the IDE crashes?
An extract of part of the subclassing code:
In the form load event.
SetWindowSubclass Me.hwnd, AddressOf SubClassProc, ID
In the form unload event.
RemoveWindowSubclass, Me.hwnd, AddressOf SubClassProc, ID
Public Function SubClassProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, _
ByVal uIdSubclass As Long, ByVal dwRefData As Long) As Long
On Error Resume Next
Select Case uMsg
Case WM_NOTIFY
(call some code)
Case UserCustomMesssage
(call some code)
End Select
SubClassProc = DefSubclassProc(hwnd, uMsg, wParam, lParam)
End Function
Tags for this Thread
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
|