Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

Post by dutch »

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.
Image

This screen is not responding
Image

Thank you in advance,
Last edited by dutch on Wed Jul 22, 2015 10:55 am, edited 3 times in total.
Regards,
Dutch

FWH 19.01 / 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)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Program hang after upgrade to 1505, How to check?

Post by Antonio Linares »

Dutch,

Could you please test it with FWH 15.06 ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after upgrade to 1505, How to check?

Post by dutch »

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 19.01 / 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)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Program hang after upgrade to 1505, How to check?

Post by Antonio Linares »

Embarcadero
regards, saludos

Antonio Linares
www.fivetechsoft.com
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Program hang after upgrade to 1505, How to check?

Post by AntoninoP »

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...
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after upgrade to 1505, How to check?

Post by dutch »

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

Thanks, I will try.
Regards,
Dutch

FWH 19.01 / 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)
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after upgrade to 1505, How to check?

Post by dutch »

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 19.01 / 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)
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: Program hang after 1505, *TSButton (Disable) Problem*

Post by AntoninoP »

I just tried TSButton from:
https://bitbucket.org/fivetech/fivewin- ... button.zip
applying:
https://fivewin-contributions.googlecod ... 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: Select all

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?
User avatar
carlos vargas
Posts: 1421
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Program hang after 1505, *TSButton (Disable) Problem*

Post by carlos vargas »

yo me recuerdo haber hecho algunas correcciones de este tipo en bpaint, si bien no uso la clase.
puedev revisar el codigo y realizar _ donde fuere necesario.
http://castillolawyers.no-ip.info/owncl ... crBbBHe7hH
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after 1505,*TSButton (Disable) w/Image Problem*

Post by dutch »

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: Select all

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 19.01 / 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)
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Program hang after 1505, *TSButton-Disable (nil) Problem*

Post by Otto »

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


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

Post by dutch »

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: Select all

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: Select all

void DrawGray( HDC hDC, HBITMAP hBmp, signed int iRow, signed int iCol ) ;
I fixed by add 2 new parameter in BPAINT.C

Code: Select all

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 19.01 / 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)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

Post by Antonio Linares »

Dutch,

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

What to change ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

Post by dutch »

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 19.01 / 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)
User avatar
Uwe.Diemer
Posts: 81
Joined: Mon Aug 09, 2010 11:00 am

Re: Program hang after 1505, *TSButton-Disable (nil)* *Fixed*

Post by Uwe.Diemer »

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
Post Reply