Page 1 of 1

Fix for FWH 7.11

Posted: Fri Nov 16, 2007 11:56 pm
by Antonio Linares
This is a necesary fix for FWH 7.11 in Class TMsgBar:

Code: Select all

METHOD SetMsg( cText ) CLASS TMsgBar

   DEFAULT ::cMsg := ""
   
   if ::l2007
      ::cMsg = cText
      ::Refresh()
      return nil
   endif   
   
   ::GetDC()   // must be placed here!!!
   ...

Posted: Sat Nov 17, 2007 11:10 am
by kajot
I can't complite this source ( FWH 7.11 and xAHRBOUR.COM November 2007)

my log:
Type: C >>>xhb.exe -o"Obj\msgbar.c" -m -n -p -q -gc0 -B -D-w2 -I"C:\fwh\include" -I"R:\include" -I"R:\include\w32" "Source\Classes\msgbar.prg"<<<

xHarbour Compiler build 1.0.0 (SimpLex)
Copyright 1999-2007, http://www.xharbour.org http://www.harbour-project.org/

Source\Classes\msgbar.prg(304) Error E0020 Incomplete statement or unbalanced delimiters

Source\Classes\msgbar.prg(379) Warning W0003 Variable: 'NFLAGS' declared but not used in function: 'TMSGBAR_LBUTTONDOWN(364)'

1 error

No code generated

Type: C >>>Couldn't build: msgbar.obj<<<
Type: C >>>TMAKEOBJECT<<<
Type: C >>>TMAKEOBJECT:REFRESH<<<
Type: N >>> 1322<<<

Posted: Sat Nov 17, 2007 12:42 pm
by Antonio Linares
> Source\Classes\msgbar.prg(304) Error E0020 Incomplete statement or unbalanced delimiters

What source code do you have at line 304 ?

Posted: Sat Nov 17, 2007 1:28 pm
by kajot
sorry, I leave one )

Re: Fix for FWH 7.11

Posted: Wed Nov 21, 2007 7:18 pm
by Patrick Mast
Antonio Linares wrote:This is a necesary fix for FWH 7.11 in Class TMsgBar:

Code: Select all

METHOD SetMsg( cText ) CLASS TMsgBar

   DEFAULT ::cMsg := ""
   
   if ::l2007
      ::cMsg = cText
      ::Refresh()
      return nil
   endif   
   
   ::GetDC()   // must be placed here!!!
   ...
What goes wrong if we don't do this fix?

Patrick

Posted: Wed Nov 21, 2007 7:19 pm
by Antonio Linares
Patrick,

Its a bad memory leak, as a hDC is created everytime the mouse is moved, and it is not released!

That fix should be applied inmediately if 2007 clause is used

Posted: Thu Nov 22, 2007 10:40 am
by Patrick Mast
Antonio Linares wrote:Patrick,

Its a bad memory leak, as a hDC is created everytime the mouse is moved, and it is not released!

That fix should be applied inmediately if 2007 clause is used
Ok, thank you.

Patrick