FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posted: Mon Jul 20, 2015 06:17 AM
I rebuild my program with FWH1505/xHB1411 and it hang (not responding) as picture. I change to rebuild it with FWH1312/xHB1310, it is working well.
I guess, it depend on the control in the screen. It works fine with a few control but this screen has a lot of control.

How can I check the problem?

This is normal screen.


This screen is not responding


Thank you in advance,
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Program hang after upgrade to 1505, How to check?
Posted: Mon Jul 20, 2015 01:30 PM

Dutch,

Could you please test it with FWH 15.06 ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after upgrade to 1505, How to check?
Posted: Tue Jul 21, 2015 02:54 AM
Dear Antonio,

Where is BCC7?
dutchez4 @ gmail.com
Antonio Linares wrote:Dutch,

Could you please test it with FWH 15.06 ? thanks
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Program hang after upgrade to 1505, How to check?
Posted: Tue Jul 21, 2015 06:30 AM

Embarcadero

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: Program hang after upgrade to 1505, How to check?
Posted: Tue Jul 21, 2015 07:49 AM

just curiosity, can you try to remove some controls from dialog?
Looks like the problem is the disabled button: in the second screen is half painted...

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after upgrade to 1505, How to check?
Posted: Tue Jul 21, 2015 09:18 AM

OK, I will try. The new version doesn't help. It's still the same.

Thanks, I will try.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after upgrade to 1505, How to check?
Posted: Tue Jul 21, 2015 09:58 AM
Dear AntinioP,

I found the problem now. The (Disable) TSButton is effected with the new version (1505). I try to remark the WHEN Clause, it works fine.

How can I fix it?
AntoninoP wrote:just curiosity, can you try to remove some controls from dialog?
Looks like the problem is the disabled button: in the second screen is half painted...
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: Program hang after 1505, *TSButton (Disable) Problem*
Posted: Tue Jul 21, 2015 01:42 PM
I just tried TSButton from:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/tsbutton.zip
applying:
https://fivewin-contributions.googlecode.com/files/bpaint.zip

I think the problem is GETFONTHEIGHT, that is defined in fivewin with a parameter as HFont and defined in bpaint.c with 2 parameters: an HDC and an HFont.
Locally I renamed the bpaint version as GETFONTHEIGHT2 and replaced all calls.

Done this, and recompiled it with FiveWin 15.03, MSVS and Harbour, the sample file works, even it writes in TESTBTN.log
Code (fw): Select all Collapse
07/21/15 15:32:02: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TCONTROL:DESTROY(2197) <-TSBUTTON:DESTROY(964) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSBUTTON:HANDLEEVENT(1317) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578)
    ------------------------------------------------------------    
07/21/15 15:32:02: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-TCONTROL:DESTROY(2197) <-TSBUTTON:DESTROY(964) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSBUTTON:HANDLEEVENT(1317) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578)
    ------------------------------------------------------------    
07/21/15 15:32:02: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------    
07/21/15 15:32:02: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------    
07/21/15 15:32:02: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -2 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------    
07/21/15 15:32:21: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TCONTROL:DESTROY(2197) <-TSBUTTON:DESTROY(964) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSBUTTON:HANDLEEVENT(1317) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578)
    ------------------------------------------------------------    
07/21/15 15:32:21: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-TCONTROL:DESTROY(2197) <-TSBUTTON:DESTROY(964) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSBUTTON:HANDLEEVENT(1317) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578)
    ------------------------------------------------------------    
07/21/15 15:32:21: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------    
07/21/15 15:32:21: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------    
07/21/15 15:32:21: EXCESS RELEASE OF FONT MS Sans Serif[ hFont : 0] ( nCount : -2 )
     <-TFONT:END(246) <-TSAY:DESTROY(2197) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1746) <-TSAY:HANDLEEVENT(227) <-_FWH(3363) <-SENDMESSAGE(0) <-(b)TWINDOW(578) <-TMDICLIENT:SENDMSG(0)
    ------------------------------------------------------------


Anyway, I think your problem is the GETFONTHEIGHT

PS: Are you sure you can not convert them in TBtnBmp?
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Program hang after 1505, *TSButton (Disable) Problem*
Posted: Tue Jul 21, 2015 04:28 PM
yo me recuerdo haber hecho algunas correcciones de este tipo en bpaint, si bien no uso la clase.
puedev revisar el codigo y realizar los cambios donde fuere necesario.
http://castillolawyers.no-ip.info/owncloud/index.php/s/PQL0ucrBbBHe7hH
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after 1505,*TSButton (Disable) w/Image Problem*
Posted: Wed Jul 22, 2015 02:54 AM
Dear AnotonioP and Carlos,

AntonioP : I try to change GETFONTHEIGHT -> GETFONTHEIGHT2 in all place. -> Rebuild SButtonx.lib -> unsuccessful and still hang when SBUTTON is disable
Carlos : I try to use all your files. -> Rebuild SButtonx.lib -> unsuccessful and still hang when SBUTTON is disable

I think disable stage is the problem and I try without RESOURCE (image), it has not problem.
Finally, the problem is DISABLE with (nil 3rd parameter of RESOURCE)!!!.
The 3rd array of Resource is nil, the Sbutton will be Dark Gray Color.
Code (fw): Select all Collapse
RESOURCE 'NEW1', 'NEW1', nil, 'NEW4' ;  => Hang
RESOURCE 'NEW1', 'NEW1', 'NEW3', 'NEW4' ; => No problem

I use many TSButton in my program. It is big job if change to TBtnBmp or TRbBtn.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Program hang after 1505, *TSButton-Disable (nil) Problem*
Posted: Wed Jul 22, 2015 06:42 AM
Hello Dutch,

I did this job some times ago.
I changed AUTOCODE so I could select TSButton and had a switch that this was automatically changed to BTNBMP button.
Search the forum. We published the source code of AUTOCODE in the forum.
Best regards,
Otto


Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posted: Wed Jul 22, 2015 11:08 AM
Dear Otto,

Thank you for your kind help. I found the problem now. It is the C Function in new FWH version.

Dear Antonio,

Could you change this function to Backward Compatible by default width, height := 0
Code (fw): Select all Collapse
void DrawGray( HDC hdc, HBITMAP hbm, int y, int x, int width, int height )
{
   HDC      hdcBmp = CreateCompatibleDC( hdc );
   HBITMAP  hbmOld;
   BITMAP   bm;
   COLORREF TransColor, col;
   int      i, j, sum;

   GetObject( hbm, sizeof( BITMAP ), ( LPSTR ) &bm );

   hbmOld = ( HBITMAP ) SelectObject( hdcBmp, hbm );
   TransColor = GetPixel( hdcBmp, 0, 0 );

   if ( width == 0 ) width = bm.bmWidth;
   if ( height == 0 ) height = bm.bmHeight;

   for( i = 0; i < width; i++ )
      for( j = 0; j < height; j++ )
      {
         col = GetPixel( hdcBmp, i , j );
         if( col != TransColor )
         {
            sum = GetRValue( col ) / 3 + GetGValue( col ) / 3 + GetBValue( col ) / 3;
            if( sum )
            {
               if( sum < ( 255 - 20 ) )
                  sum += 20;
               else
                  sum = 255;
            }
            SetPixel( hdc, i + x, j + y, RGB( sum, sum, sum ) );
         }
      }

   SelectObject( hdcBmp, hbmOld );
   DeleteDC( hdcBmp );
}

TSButton use this function in BPAINT.C and missing 2 new parameter.
Code (fw): Select all Collapse
void DrawGray( HDC hDC, HBITMAP hBmp, signed int iRow, signed int iCol ) ;


I fixed by add 2 new parameter in BPAINT.C
Code (fw): Select all Collapse
void DrawGray( HDC hDC, HBITMAP hBmp, signed int iRow, signed int iCol, signed int width, signed int height ) ;
..
DrawGray( hDC, hBitMap1, nTop, nLeft ,0 ,0 ) ;


Thank you for everyone.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posted: Thu Jul 23, 2015 07:44 AM

Dutch,

Your posted function DrawGray() is exactly like the one in FWH sources.

What to change ? :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posted: Thu Jul 23, 2015 10:44 AM
Dear Antonio,

Could you set default for width and height in FW source as 0, if do not put these 2 parameter? Because the TSButton use this function from FW but has no 2 new parameter (width/height), if possible.

Thanks.
Antonio Linares wrote:Dutch,

Your posted function DrawGray() is exactly like the one in FWH sources.

What to change ? :-)
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 99
Joined: Mon Aug 09, 2010 11:00 AM
Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*
Posted: Mon Jun 10, 2019 09:13 AM

Hello Dutch

i changed it and get

--------------------Konfiguration: Optowin - Release--------------------
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
C:\Dev\Optowin\Tsbutton\SOURCE\FUNCTION\BPAINT.C:
Error E2227 C:\Dev\Optowin\Tsbutton\SOURCE\FUNCTION\BPAINT.C 494: Extra parameter in call to DrawGray in function HB_FUN_SBTNPAINT
*** 1 errors in Compile ***
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Optowin.EXE - 1 Fehler, 0 Warnung(en)

Tx