Tim,
I don't know, why the brush gets lost.
Another solution could be to define the brush LOCAL :
FUNCTION Main()
LOCAL
oBrush2 c_path := GETCURDIR()
DEFINE BRUSH
oBrush2 FILENAME c_path + "\Images\Stone.bmp"
DEFINE WINDOW oWnd TITLE "Testing Brush
...
...
DEFINE BUTTON oButt1 OF oBar FILE c_path + "\Logo\16x16N.bmp" ;
MESSAGE "Resource" ;
ACTION D_RESOURCE(
oBrush2) ;
PROMPT "Resource"
ACTIVATE WINDOW oWnd MAXIMIZED
oBrush2:End()RETURN NIL
// -------------------------
FUNCTION D_RESOURCE(
oBrush2)
LOCAL oDlg1
DEFINE DIALOG oDlg1 RESOURCE "Group" TITLE "Dialog-test" PIXEL TRANSPARENT
ACTIVATE DIALOG oDlg1 CENTERED NOWAIT ;
ON INIT IIF(
oBrush2:hBitmap != 0, oDlg1:SetBrush(
oBrush2 ), MsgAlert( "Brush not defined !", "ERROR" ) )
RETURN NIL
Best Regards
Uwe