Re: Machine level error in win32lib

new topic     » goto parent     » topic index » view thread      » older message » newer message
penpal0andrew said...

I am using win32lib version 0.70.4a 17/June/2008

The failure occurs (from the err file) at the first poke in the code below.

This is from the ex.err file:

c:\euphoria\win32lib\include\Win32lib.ew:23310 in function fDoTTN_GETDISPINFO() A machine-level exception occurred during execution of this statement.

The problem is that I do not know how to connect this to my program. The error is occurring when I switch tabs. I think win32lib is allocating space for the hints I have set up for fields in that tab, and the hint text happens to be greater than 80 characters.

Since this error does not happen consistently, could there be a problem, because in my program, I manage memory buffers with allocate, free, mem_copy, and poke, in addition to release_mem and w32store?

Andy Katz

        if length(lText)>80 then -- use our private buffer 
            if TTTextPtr = 0 then  -- first use 
                TTTextPtr = w32acquire_mem(0,lText) 
                TTStrLen = lTextLen 
            elsif TTStrLen<=length(lText) then -- buffer too small, get another one 
                w32release_mem(TTTextPtr) 
                TTStrLen = lTextLen 
                TTTextPtr = w32acquire_mem(0,lText) 
            else -- use current bufer, as it is large enough 
                poke(TTTextPtr,lText) 
                poke(TTTextPtr+length(lText),0) 
            end if 
            w32store( lParam, NMTTDISPINFO_lpszText, TTTextPtr ) 
 
        else 
            w32store( lParam, NMTTDISPINFO_szText, lText ) 
        end if 
 
        VOID = w32Func(xSendMessage,{w32fetch(lParam, NMHDR_hwndFrom ), 
                          TTM_SETMAXTIPWIDTH, 0, 
                          lTextLen}) 

Are you allocating enough memory ? Length of text + ONE ( for the ZERO )

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu