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

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

Postby dutch » Mon Jul 20, 2015 6: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.
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
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Antonio Linares » Mon Jul 20, 2015 1:30 pm

Dutch,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby dutch » Tue Jul 21, 2015 2: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 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: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Antonio Linares » Tue Jul 21, 2015 6:30 am

Embarcadero
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby AntoninoP » Tue Jul 21, 2015 7: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...
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

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

Postby dutch » Tue Jul 21, 2015 9:18 am

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: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby dutch » Tue Jul 21, 2015 9: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 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: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby AntoninoP » Tue Jul 21, 2015 1: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: Select all  Expand view
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?
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

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

Postby carlos vargas » Tue Jul 21, 2015 4: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)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

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

Postby dutch » Wed Jul 22, 2015 2: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: Select all  Expand view
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
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Otto » Wed Jul 22, 2015 6: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


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby dutch » 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: Select all  Expand view
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  Expand view
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  Expand view
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
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Antonio Linares » Thu Jul 23, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby dutch » 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 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: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Postby Uwe.Diemer » Mon Jun 10, 2019 9: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
User avatar
Uwe.Diemer
 
Posts: 93
Joined: Mon Aug 09, 2010 11:00 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests

cron