tOutLook2003 sobre mdichild

tOutLook2003 sobre mdichild

Postby fgondi » Fri Dec 19, 2008 10:46 am

Tengo una barra OutLook2003 incrustada en una ventana mdichild.

Al cerrar la ventana mdichil y volverla a abrir se me cerraba el programa.

Buscando el problema encontre que se producía en el método paint de la clase tOutLook2003.
Mas concretamente en la línea donde se llama a FillRect

Code: Select all  Expand view
METHOD Paint() CLASS TOutLook2003

   local n, nTop
   local aInfo := ::DispBegin()   

   FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
...


El motivo es que en la segunda vez que se carga la barra OutLook2003 ::oBrush no se ha definido.

Buscando donde se define el brush por defecto en la clase tOutLook2003 encontre que se define en el método Register de la clase tWindow
Code: Select all  Expand view
METHOD Register( nClsStyle )  CLASS TWindow

   local hUser

   DEFAULT ::lRegistered := .f. // XBPP workaround

   if ::lRegistered
      return nil
   endif

   #ifdef __CLIPPER__
      hUser = GetModuleHandle( "user.exe" )
   #else
      hUser = GetInstance()
   #endif

   DEFAULT nClsStyle  := nOR( CS_VREDRAW, CS_HREDRAW ),;
           ::nClrPane := GetSysColor( COLOR_WINDOW ),;
           ::oBrush   := TBrush():New( ,::nClrPane )
...


Pero la segunda vez que se llama a la definición de la barra OutLook2003 la data ::lRegistered tiene valor .T. por lo que abandona método Register antes de llegar a la definición DEFAULT de ::oBrush.

Desconozco si esto tiene que funcionar así y cual debe ser la solución mas correcta.
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Postby fgondi » Tue Dec 23, 2008 8:25 am

Bueno, pues yo lo he solucionado de esta forma

Code: Select all  Expand view
METHOD Paint() CLASS TOutLook2003

   local n, nTop
   local aInfo := ::DispBegin()   

   if ::oBrush<>NIL
     FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush
   endif
...


No se si será la mas correcta, pero ahora funciona.
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: tOutLook2003 sobre mdichild

Postby fgondi » Fri May 07, 2010 11:24 am

Sigo usando outlook2003 con este cambio.

Nadie mas tiene este problema?
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests