Re: Can't be solved: Error code 473 - Unable to allocate memory
- Posted by CChris <christian.cuvier at agric?lture.go?v.fr> Dec 10, 2007
- 542 views
Pete Lomax wrote: > > Nemo wrote: > > > > please check out the following lines > > > > ... called from C:\IDE\w32memory.ew:1265 in function w32acquire_handle() > > size = -1 > > Ah, that looks suspicious... > > > ... called from C:\IDE\w32resources.ew:759 in procedure > > setPrinterPointers() > > flag = 0 > > phndl = 39745968 > > ptr = <no value> > > ptr2 = <no value> > > OK, if we look in that routine, we find this pile of steaming doo-doos: > > }}} <eucode> > phndl=allocate(4) > VOID=w32Func(xOpenPrinter,{pname,phndl,0}) > vPrinterHandle=peek4u(phndl) > vDevmodeSize=w32Func(xDocumentProperties,{0,vPrinterHandle,pname,0,0,0}) > hdefPtr=w32acquire_handle(GMEM_MOVEABLE,vDevmodeSize) > </eucode> {{{ > > So it is completely ignoring any failure by OpenPrinter/DocumentProperties. > In both cases it should be calling GetLastError 'n stuff for more details. > > Also, pname=0 which suggests a failure setting that has gone unreported. > Obviously if you're going to leave pname 0 and run into that code, it is > always > going to crash. > > Sorry, not my job to fix this, though. > > Regards, > Pete Obviously there's something wrong with either the printer configuration or with the way the lib etects it. Nemo: please locate, in w32resources.ew, the line vPrinterName = getDefaultPrinterName() (should be at line 742), add }}} <eucode>puts(1,vPrinterName)</eucode> {{{ right after it, and tell us what got displayed? Also, at line 684 or close, locate rc = w32Func(xGetDefaultPrinter,{pBuffer,pNeeded}) and add a ?rc after that. The value displayed could be interesting. CChris