MoreListIcon userlib + callback = big crash?

Windows specific forum
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

MoreListIcon userlib + callback = big crash?

Post by Karbon »

Hopefully it's just something silly I'm doing causing this crash.. Using this code if I click on a header a few times (the number of times seems random) it bombs the entire application. OnError isn't much help as from what I understand it can report some crazy stuff with code in callbacks (and does, in this case!).

Hopefully someone can give me a hand! Thanks!

Code: Select all

  If Message = #WM_NOTIFY        ; these events are send as notification messages
    
    *pnmh.NMHDR = lParam  ; lParam points to a structure with more info
    
    Select *pnmh\hwndFrom
    
      ;
      ; See if it is the right gadget
      ;
      Case GadgetID(#Gadget_main_lst_c_search_results) 
        
        ;
        ; This code contains actual message
        ;
        Select *pnmh\code  
          
          ;
          ; User clicked on the Header of a column
          ;
          Case #LVN_COLUMNCLICK 
            
            *pnmv.NMLISTVIEW = lParam ; another info structure
            
            Column.l = *pnmv\iSubItem ; clicked column
            
            ;
            ; Column starts at 0
            ;
            header_text.s = GetColumnHeaderText(#Gadget_main_lst_c_search_results, Column)
            
            If Right(header_text,1) = "<"

              order_dir.s = "ASC"
              
              order_char.s = ">"
               
            Else
              
              order_dir.s = "DESC"
              
              order_char.s = "<"
              
            EndIf
            
            ;MessageRequester("Column Header Click","Clicked on Column "+Str(Column)+Right(header_text,1),0)
            
            ;
            ; Reset all the order characters
            ;
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 0, "Customer ID")
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 1, "Customer Name")
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 2, "Address")
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 3, "City")
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 4, "State")
            SetColumnHeaderText(#Gadget_main_lst_c_search_results, 5, "Zip")
            
            Select Column
              
              ;
              ; The customer number column
              ;
              Case 0
              
                order_by.s = "customer_number"
              
              Case 1
              
                order_by.s = "customer_name"
                
              Case 2
                
                order_by.s = "bill_street1"
                
              Case 3
                
                order_by.s = "bill_city"
                
              Case 4
                
                order_by.s = "bill_state"
                
              Case 5
                
                order_by.s = "bill_zip"
              
              Default
                
                order_by.s = "customer_number"
                
            EndSelect
          
             new_header_text.s = GetColumnHeaderText(#Gadget_main_lst_c_search_results, Column)
             
             SetColumnHeaderText(#Gadget_main_lst_c_search_results, Column, new_header_text + " " + order_char)
                   
        EndSelect
    
      EndSelect
    
    EndIf   
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Denis
Enthusiast
Enthusiast
Posts: 779
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

Hi Karbon,

may be a bug in my Lib MoreListIconGadget. I have to take a closer look.

Please, send-me all your code by e-mail (Denislabarre@Free.fr) and wich OS you are using to.

Tks

Denis
A+
Denis
Denis
Enthusiast
Enthusiast
Posts: 779
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

I've fixed a bug in my Lib MoreListiconGadget (reported by Karbon).
It will be avalaible this week-end (i hope).


Denis
A+
Denis
Post Reply