Re: WinLib Bugs 12/2007

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

Al Getz wrote:
> 
> Hello there,
> 
> 
> I DL'd the latest version (i guess it is) from the archives and
> ran into a few problems.  I'll number them here...
> 
> 1.  Trying to unzip the .zip file leads to a problem (XP-SP2) that says that
>     some of the files are password protected.  This makes it harder
>     to unzip and therefore use the library.  This should be corrected.

The bug is in Microsoft's code. Ask Microsoft to fix it. I've had no problems
with it at all. I use Directory Opus to unzip and that just works.
 
> 2.  In file w32resources.ew, in procedure setPrinterPointers,
>     apparently this function is called automatically as the lib is loaded.
>     The problem comes in when the user does not have a printer installed
>     in the system (had problems with mine so im not using it right now).
>     The vDevmodeSize variable gets loaded to -1 and this causes an
>     error 473 that states that memory can not be allocated.  The workaround
>     was to simply test this var for less than zero and load it with 256.
>     This number was picked at random just to get things booted up so
>     more research time will have to be put into this issue for whoever
>     is working on this Lib now.  Keep in mind that many systems will not
>     have a printer installed so it's a good idea to fix this.


In w32resources.ew find the setPrinterPointers routine and replace 

VOID = w32Func(xOpenPrinter,{pname,phndl,0})
    vPrinterHandle=peek4u(phndl)           
    vDevmodeSize =w32Func( xDocumentProperties,
                           {0,vPrinterHandle,pname,0,0,0})
    hdefPtr = w32acquire_handle(GMEM_MOVEABLE,vDevmodeSize)
    hdmPtr = w32acquire_handle(GMEM_MOVEABLE,vDevmodeSize)
    ptr = w32handle_to_memory(hdefPtr)
    ptr2 = w32handle_to_memory(hdmPtr)
    VOID = w32Func( xDocumentProperties,
                    {0,vPrinterHandle,pname,ptr,0,DM_COPY})
    mem_copy(ptr2,ptr,vDevmodeSize)
    w32release_handle(hdefPtr,0)
    w32release_handle(hdmPtr,0)


with 

if w32Func(xOpenPrinter,{pname,phndl,0}) != 0 then
    vPrinterHandle=peek4u(phndl)           
    vDevmodeSize =w32Func( xDocumentProperties,
                           {0,vPrinterHandle,pname,0,0,0})
    hdefPtr = w32acquire_handle(GMEM_MOVEABLE,vDevmodeSize)
    hdmPtr = w32acquire_handle(GMEM_MOVEABLE,vDevmodeSize)
    ptr = w32handle_to_memory(hdefPtr)
    ptr2 = w32handle_to_memory(hdmPtr)
    VOID = w32Func( xDocumentProperties,
                    {0,vPrinterHandle,pname,ptr,0,DM_COPY})
    mem_copy(ptr2,ptr,vDevmodeSize)
    w32release_handle(hdefPtr,0)
    w32release_handle(hdmPtr,0)
end if




-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

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

Search



Quick Links

User menu

Not signed in.

Misc Menu