Search found 29 matches: globalalloc

Return to advanced search

Re: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?

Antonio, Muchas gracias por responder. Lamentablemente no ha funcionado. Lo he probado con PalBmpRead() puesto que tengo el bitmap en disco. Aquí te dejo como ha quedado el metodo despues de las modificaciones: METHOD SayBitmap( nRow, nCol, xBitmap, nWidth, nHeight, nRaster ) CLASS TPrinter ...
by A.Martinez
Thu Dec 15, 2011 3:49 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Replies: 15
Views: 4090

Re: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?

A. Prueba asi:   ...           aBmpPal  = PalBmpLoad( xBitmap )      hBitmap  = aBmpPal[ 1 ]      hPalette = aBmpPal[ 2 ]      hDib   = DibFromBitmap( hBitmap, hPalette )      // PalBmpFree( hBitmap, hPalette )      DeleteObject( hBitmap ) ...
by Antonio Linares
Thu Dec 15, 2011 1:41 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Replies: 15
Views: 4090

Re: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?

Hola, Dejo como test del problema el TestPrn2.Prg que demuestra lo que digo: la pérdida/ fuga de memoria. La memoria se recupera solo al salir del programa. El problema se puede comprobar más facilmente imprimiendo pocos bitmaps, cuando el bitmap es grande, o bien, si es pequeño, imprimiendo muchas ...
by A.Martinez
Thu Dec 15, 2011 11:55 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Replies: 15
Views: 4090

oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?

... bitmap es grande entonces se ve que la memoria no es released hasta que se sale del programa. Entiendo que este no debe ser el comportamiento de GlobalAlloc()/ GlobalFree() La verdad es que me corre prisa solucionarlo. Agradecido de antemano siquiera por alguna pista. Anexo metodo (original) ...
by A.Martinez
Thu Dec 15, 2011 9:23 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: oPrinter:SayBitmap/ GlobalAlloc-GlobalFree ¿fuga de memoria?
Replies: 15
Views: 4090

Funcion PrepareInfoHeader

... ( WORD ) bm.bmWidth, ( WORD ) bm.bmHeight ); dwSizeScr = ( ( bm.bmWidth * bmiS.biBitCount + 31 ) / 32 ) * 4 * bm.bmHeight; hDibSrc = GlobalAlloc( GHND, dwSizeScr + sizeof( BITMAPINFOHEADER ) ); lpSrcBits = ( LPBITMAPINFOHEADER )GlobalLock( hDibSrc ); *lpSrcBits = bmiS; dc = GetDC ...
by softruz
Thu May 19, 2011 11:25 am
 
Forum: FiveWin para Harbour/xHarbour
Topic: Funcion PrepareInfoHeader
Replies: 7
Views: 1130

Re: Se necesita ayuda en el wiki !

... GetVersion() GetWinDir() GetWindowWord() GetWinFlags() GetWinTxtLength() GetWndApp() GetWndFrame() GetWndRect() GetWndTask() GlobalAddAtom() GlobalAlloc() GlobalCompact() GlobalData() GlobalFree() GlobalGetAtom() GlobalLock() GlobalRealloc() GlobalSize() GlobalUnlock() HasResources() HelpSearch() ...
by Cgallegoa
Sun Feb 21, 2010 10:35 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: Se necesita ayuda en el wiki !
Replies: 12
Views: 5504

Re:

... *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast Almacen.prg(1326) : error C2065: 'GlobalAlloc' : undeclared identifier Almacen.prg(1326) : error C2065: 'GMEM_MOVEABLE' : undeclared identifier Almacen.prg(1326) : error C2440: 'initializing' ...
by softruz
Thu Nov 06, 2008 10:22 am
 
Forum: FiveWin para Pocket PC
Topic: Coger la version del fichero .exe
Replies: 5
Views: 1161

... are private to a process ." So when the process is finished, all its environment is cleared, unless you have created global handles (i.e. using GlobalAlloc()). Sorry, but the docs says: GDI objects support only one handle per object. Handles to GDI objects are private to a process. That is, ...
by Enrico Maria Giordano
Fri Aug 01, 2008 11:12 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Which objects must be released explicitly
Replies: 27
Views: 4283

... are private to a process ." So when the process is finished, all its environment is cleared, unless you have created global handles (i.e. using GlobalAlloc()). http://msdn.microsoft.com/en-us/magazine/cc301756.aspx "... the documentation states that Windows takes care of releasing the resource ...
by Antonio Linares
Fri Aug 01, 2008 10:57 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Which objects must be released explicitly
Replies: 27
Views: 4283

... NULL; BOOL bOk = FALSE; if( dwSize ) { char * szBlock = ( char * ) hb_xgrab( 255 ); char * szSubBlock = ( char * ) hb_xgrab( 255 ); HGLOBAL hMem = GlobalAlloc( GMEM_MOVEABLE, dwSize ); VS_FIXEDFILEINFO * vsInfo; UINT nLen = 0; if( hMem ) { LPVOID pMem = GlobalLock( hMem ); if( pMem && GetFileVersionInfo( ...
by Marco Turco
Tue May 06, 2008 1:07 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: File-information in exe-file
Replies: 8
Views: 1907

Jeff,

>
Enrico had mentioned in another post:
"As far as I know, you can't return a string from a DLL function"
>

You can do it using a GlobalAlloc() chunk of memory, that the DLL client will free later on

> Will a standard DLL work?

Yes, why not ?
by Antonio Linares
Fri Aug 10, 2007 11:51 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: ActiveX DLL Functions
Replies: 26
Views: 5521

... sizeof bmh) != sizeof bmh || bmh.bfType != 0x4d42) { return NULL; } // Allocate global block for DIB dibSize = bmh.bfSize - sizeof bmh; hdib = GlobalAlloc(0, dibSize); pbi = (LPBYTE)GlobalLock(hdib); if (!hdib || !pbi) { return NULL; } // Read DIB from file if (_hread(fh, pbi, dibSize) != dibSize) ...
by areang
Mon Aug 07, 2006 3:33 am
 
Forum: FiveWin for Harbour/xHarbour
Topic: Please teach me about FWH and xHarbour
Replies: 3
Views: 4249

João, GlobalFree() es una función del API de Windows para liberar un bloque de memoria previamente reservado con GlobalAlloc(). Con Harbour/xHarbour debemos usar hb_xgrab() y hb_xfree() en vez de esas funciones, para que Harbour/xHarbour hagan las comprobaciones internas necesarias. ...
by karinha
Mon Jul 10, 2006 8:40 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: ¿Que hace exactamente ResAllFree() y PostQuitMessage(0)?
Replies: 6
Views: 1636

João,

GlobalFree() es una función del API de Windows para liberar un bloque de memoria previamente reservado con GlobalAlloc(). Con Harbour/xHarbour debemos usar hb_xgrab() y hb_xfree() en vez de esas funciones, para que Harbour/xHarbour hagan las comprobaciones internas necesarias.
by Antonio Linares
Mon Jul 10, 2006 5:09 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: ¿Que hace exactamente ResAllFree() y PostQuitMessage(0)?
Replies: 6
Views: 1636
Previous

Return to advanced search