FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Deleteobject function fails
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Deleteobject function fails

Posted: Thu Sep 27, 2018 11:18 AM
Hi,

In this sample deleteObject() function fails, because do not release hBrush object.
There is no DC context associate.

Please, help me.

Regards.

Code (fw): Select all Collapse
//-------------------------------------------------------------------------//
STATIC FUNCTION PruebaRecursos()

Local hBrush
Local l1, l2

hBrush:= CreateSolidBrush(CLR_RED)

l1:= isgdiobject(hbrush)
l2:= deleteobject(hbrush)

MsgInfo(Transform(l1, ""))  // .t.
MsgInfo(Transform(l2, ""))  // .f.
return nil
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: Deleteobject function fails

Posted: Thu Sep 27, 2018 11:44 AM
Your sample works fine here:

Code (fw): Select all Collapse
MsgInfo(Transform(l2, ""))  // .t.


EMG
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Deleteobject function fails

Posted: Thu Sep 27, 2018 12:15 PM
MsgInfo(Transform(l1, "")) // .t.
MsgInfo(Transform(l2, "")) // .f.

Where is the need to use Transform() here?
We can directly write

MsgInfo( l1 )
MsgInfo( l2 )

Or is there any special reason for using transform() ?
Regards



G. N. Rao.

Hyderabad, India
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Re: Deleteobject function fails

Posted: Thu Sep 27, 2018 03:48 PM
Enrico Maria Giordano wrote:Your sample works fine here:

Code (fw): Select all Collapse
MsgInfo(Transform(l2, ""))  // .t.


EMG


Yoi're right. Thks.
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Re: Deleteobject function fails

Posted: Thu Sep 27, 2018 03:49 PM
nageswaragunupudi wrote:
MsgInfo(Transform(l1, "")) // .t.
MsgInfo(Transform(l2, "")) // .f.

Where is the need to use Transform() here?
We can directly write

MsgInfo( l1 )
MsgInfo( l2 )

Or is there any special reason for using transform() ?


Yoi're right. Thks.

Continue the discussion