Hi,
Is it still required to destroy Font object to release memory occupied by it ? I am using Jun-2005 build.
TIA
Milan.
Hi,
Is it still required to destroy Font object to release memory occupied by it ? I am using Jun-2005 build.
TIA
Milan.
Yes for fonts created by yourself and used "on the fly", ie. not assigned to any controls.
EMG
Does this mean if the program is terminated with oWnd:end() that the FONT is still occupying the memory?
Is there a function to know which Fonts one have ceated?
Thanks in advance
Otto
Otto,
In this thread we explain how to check all created GDI objects:
viewtopic.php?f=3t=15935start=0hilit=gdi+resources
&&&
Antonio,
I don’t understand exactly when a FONT has to be released.
If I look into the new tribbon classe I see that ::oFont is created.
How is this Font released?
If I use for example:
Func test(oFont)
Local oFont1
oFont1:=oFont
return nil
Do I have 2 fonts and must I release oFont1?
Thanks in advance
Otto
if ::oFont == nil
::oFont := TFont():New()
::oFont:hFont := GetStockObject( DEFAULT_GUI_FONT )
endifDEFINE FONT oFont NAME ... SIZE ..., ...oFont:End()METHOD paint()
do while .not. EOF()
IF PLAN_DB->jahrgang4 = "MELD"
::paintChartFont := ::oFont
else
::paintChartFont := ::planFont
ENDIF
::PaintChart( )
skip
ENDDO
return nil
//----------------------------------------------------------------------------//
METHOD PaintChart()
hOldFont := SelectObject( ::oWnd:hDC, ::paintChartFont:hFont )
DrawText( ::oWnd:hDC, cChartCaption,{ nCurRow - 6 ,;
StartPX + nTemp ,;
nCurRow + ::nRowHeight ,;
StartPX + nDurationPX + ::nColWidth/2 - 2 }, nStyle )
SelectObject( ::oWnd:hDC, hOldFont )
DeleteObject( hOldFont )
return nil
//----------------------------------------------------------------------------//Otto,
No, you are just creating an alias for the same font object.
To create a copy of an object:
oNew := oClone( oObject )
James
James,
Thank you James for explaining this to me.
Best regards,
Otto
James, Otto,
Please be aware that oClone() should not be used with Windows handles as those can't be "cloned" ![]()
Antonio,
Thanks for pointing that out. Very important!
James