1. RE: Using tab controls, program crashes on Win98. Film at 11.

> -----Original Message-----
> From: Jonas Temple [mailto:jktemple at yhti.net]
 
> I have a program that I developed on my Win95 machine and it works 
> great.  The program uses:
> - Win32Lib
> - Tab control with a list view in each tab item
> 
> Run this program on Win98 and it crashes on closeWindow.  Anyone seen 
> this strange and odd behavior?  Caught this on film?  Send it in to 
> "Stange and Unsolved MS Phenomenon".  :)

new topic     » topic index » view message » categorize

2. RE: Using tab controls, program crashes on Win98. Film at 11.

> -----Original Message-----
> From: Jonas Temple [mailto:jktemple at yhti.net]
 
> I have a program that I developed on my Win95 machine and it works 
> great.  The program uses:
> - Win32Lib
> - Tab control with a list view in each tab item
> 
> Run this program on Win98 and it crashes on closeWindow.  Anyone seen 
> this strange and odd behavior?  Caught this on film?  Send it in to 
> "Stange and Unsolved MS Phenomenon".  :)  

Sorry, hit send on the last without saying anything...

This seems to be a bug in the TabControl code in the common controls DLL.
It doesn't like getting the LVN_DELETEALLITEMS notification, which it gets
just before a child listview item is destroyed.  In SubProc, you can add the
following right before the call to the tab control's default window proc
(which I've included here):

if window_type[id] = TabControl and iMsg = WM_NOTIFY then

    VOID = fetch( lParam, NMHDR_code )
    if VOID = LVN_DELETEALLITEMS then
        return popSelf()
    end if
end if
returnValue( w32Func( xCallWindowProc, { window_func[id], hWnd, iMsg,
wParam, lParam } ))


Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

3. RE: Using tab controls, program crashes on Win98. Film at 11.

Matthew Lewis wrote:
> This seems to be a bug in the TabControl code in the common controls 
> DLL.
> It doesn't like getting the LVN_DELETEALLITEMS notification, which it 
> gets
> just before a child listview item is destroyed.  In SubProc, you can add 
> the
> following right before the call to the tab control's default window proc
> (which I've included here):
> 
> if window_type[id] = TabControl and iMsg = WM_NOTIFY then
> 
>     VOID = fetch( lParam, NMHDR_code )
>     if VOID = LVN_DELETEALLITEMS then
>         return popSelf()
>     end if
> end if
> returnValue( w32Func( xCallWindowProc, { window_func[id], hWnd, iMsg,
> wParam, lParam } ))
> 
> 
> Matt Lewis
> 
> 
Matt,

Just got back around to applying this patch and I can't figure out where 
it goes into SubProc in Win32Lib.  Could you maybe include the entire 
SubProc function with the changes needed?  Thanks a bunch!

Jonas

new topic     » goto parent     » topic index » view message » categorize

4. RE: Using tab controls, program crashes on Win98. Film at 11.

> -----Original Message-----
> From: Jonas Temple [mailto:jktemple at yhti.net]

> Just got back around to applying this patch and I can't 
> figure out where 
> it goes into SubProc in Win32Lib.  Could you maybe include the entire 
> SubProc function with the changes needed?  Thanks a bunch!

Here's the entirety of SubProc in my copy of Win32Lib (with formatting
slightly mangled by email).  I've highlighted the new stuff...

-- begin code

function SubProc( atom hWnd, atom iMsg, atom wParam, atom lParam )
-

    -- callback routine to handle Window class
    -- This routine processes messages sent by Windows

integer
      id
    , lHandledEvent

object
      result
    -- find the control
    id = getId( hWnd )

    -- not one of mine?
    if id = 0
    then     -- default processing
        return True
    end if
    -- user can process events that Win32Lib doesn't have handlers for.
    if   onEvent[ id ] >= 0
      or onEvent[Screen] >= 0
      or window_eventhandler[id][w32HEvent] >= 0
      or window_eventhandler[Screen][w32HEvent] >= 0
    then
        pushSelf( id ) -- save the id for getSelf()
        invokeHandler(id, w32HEvent, {iMsg, wParam, lParam} )
        if sequence(myReturn[length(myReturn)])
        then -- user supplied a return code, so return to Windows
            return popSelf()
        else
            VOID = popSelf()
        end if

    end if

    lHandledEvent = find(iMsg, vEventsHandled)
    if lHandledEvent = 0
    then     -- default processing
        return w32Func( xCallWindowProc, { window_func[id], hWnd, iMsg,
wParam, lParam } )
    end if

    -- save the id for getSelf()
    pushSelf( id )

    if vHandler[ lHandledEvent ] >= 0
    then
        result = call_func(vHandler[ lHandledEvent ], {id, hWnd, iMsg,
wParam, lParam, 				kWinDefProc})
        if result[1] = kWinDefProc
        then
           if length(result) = 2
           then -- the handler has altered the input parameters
              hWnd   = result[2][1]
              iMsg   = result[2][2]
              wParam = result[2][3]
              lParam = result[2][4]
           end if
--   ****************************************************************
--   HERE'S THE NEW CODE:
           if window_type[id] = TabControl and iMsg = WM_NOTIFY then

               VOID = fetch( lParam, NMHDR_code )
               if VOID = LVN_DELETEALLITEMS then
                   return popSelf()
               end if
           end if
--   THAT'S IT
--   ****************************************************************

           returnValue( w32Func( xCallWindowProc, { window_func[id], hWnd,
iMsg, wParam, 

				lParam } ))


      end if
    end if

    return popSelf()

end function

-- end code

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

5. RE: Using tab controls, program crashes on Win98. Film at 11.

Matt,

I applied your patch and now the program crashes only when the tab 
items/list views are loaded/displayed.  If I don't load/display the list 
tab items/list views the program closes fine.

Jonas

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu