Results 1 to 20 of 20

Thread: IDE crashing after running a program with subclassing

Hybrid View

  1. #1
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,909

    Re: IDE crashing after running a program with subclassing

    Hi Ted,

    What's most obvious to me is that you've got an extra comma in your call to RemoveWindowSubclass. I'm not sure you're getting it removed.

    Quote Originally Posted by TedH View Post
    RemoveWindowSubclass, Me.hwnd, AddressOf SubClassProc, ID
    That actually makes me wonder how you've got RemoveWindowSubclass declared. I wouldn't mind seeing that too. Here are mine:

    Code:
    
    Private Declare Function SetWindowSubclass Lib "comctl32.dll" Alias "#410" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, Optional ByVal dwRefData As Long) As Long
    Private Declare Function GetWindowSubclass Lib "comctl32.dll" Alias "#411" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, pdwRefData As Long) As Long
    Private Declare Function RemoveWindowSubclass Lib "comctl32.dll" Alias "#412" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long) As Long
    Private Declare Function DefSubclassProc Lib "comctl32.dll" Alias "#413" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    Good Luck,
    Elroy
    Last edited by Elroy; Jan 21st, 2018 at 09:58 AM.
    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.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Feb 2017
    Posts
    31

    Re: IDE crashing after running a program with subclassing

    Private Declare Function DefSubclassProc Lib "comctl32.dll" (ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Private Declare Function SetWindowSubclass Lib "comctl32.dll" (ByVal hwnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, ByVal dwRefData As Long) As Long
    Private Declare Function RemoveWindowSubclass Lib "comctl32.dll" (ByVal hwnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long) As Long

    GetWindowSubclass not used.

    However, the subclassing all works fine with the program running from an EXE or within the IDE. Whilst running, various windows are opened and subclassed, and later de-subclassed and closed with no apparent problems.
    It's only when I close the program (when running it in the IDE) that the IDE crashes.
    Last edited by TedH; Jan 21st, 2018 at 10:35 AM.

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
  •  



Click Here to Expand Forum to Full Width