Deleteobject function fails

Deleteobject function fails

Postby hmpaquito » 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: Select all  Expand view  RUN
//-------------------------------------------------------------------------//
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
 
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Deleteobject function fails

Postby Enrico Maria Giordano » Thu Sep 27, 2018 11:44 am

Your sample works fine here:

Code: Select all  Expand view  RUN
MsgInfo(Transform(l2, ""))  // .t.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Deleteobject function fails

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Deleteobject function fails

Postby hmpaquito » Thu Sep 27, 2018 3:48 pm

Enrico Maria Giordano wrote:Your sample works fine here:

Code: Select all  Expand view  RUN
MsgInfo(Transform(l2, ""))  // .t.


EMG


Yoi're right. Thks.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Deleteobject function fails

Postby hmpaquito » Thu Sep 27, 2018 3: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.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 65 guests