Page 1 of 1

MoreListIcon userlib + callback = big crash?

Posted: Tue Dec 09, 2003 5:00 am
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   

Posted: Wed Dec 10, 2003 2:25 pm
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

Posted: Fri Dec 12, 2003 5:43 pm
by Denis
I've fixed a bug in my Lib MoreListiconGadget (reported by Karbon).
It will be avalaible this week-end (i hope).


Denis