-
Dec 4th, 2003, 11:42 AM
#1
Thread Starter
Fanatic Member
subclassing and getting normal again
hi there !
i want to subclass a listview in order to sort according to dates.
i do something like this according to msdn:
SendMessage lv_user.hWnd, LVM_SORTITEMS, lv_user.hWnd, AddressOf CompareDates
where comparedates is a sub
now the problem is
that after i clear the listview and add new listitems
they are not being displayed properly.
is there a way to return to normal after subclassing.
is this dangerous for crashes ?
thanks !
-
Dec 4th, 2003, 04:49 PM
#2
Addicted Member
I think you don't have a special need to send this kind of addressof. Why don't you only SendMessage, without addressof parameter ?
If you really want to subclass, you should have some rules, like use Windows Database to store Long values, like:
(Form_Load)
SetProp listView.hwnd, "lpPROC", SetWindowLong(ListView.hwnd, GWL_WNDPROC, AddressOf ProcedureHOOK)
and to unsubclass
(Form_Unload)
Dim RetVal As Long
RetVal = SetWindowLong(ListView.hwnd, GWL_WNDPROC, GetProp(ListView.hwnd, "lpPROC"))
RemoveProp ListView.hwnd, "lpPROC"
This way, you never will crash because when you unsubclass, the real value will be passed. I bealive this will help you.
-
Dec 4th, 2003, 06:29 PM
#3
If you want to do it without subclassing see 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
|