#include "Fivewin.ch"
FUNCTION MAIN()
聽 聽 LOCAL oDlg
聽 聽 DEFINE DIALOG oDlg;
聽 聽 聽 聽 聽 聽TITLE REPLICATE( "X", 115 )
聽 聽 ACTIVATE DIALOG oDlg;
聽 聽 聽 聽 聽 聽 聽CENTER
聽 聽 RETURN NILEMG
#include "Fivewin.ch"
FUNCTION MAIN()
聽 聽 LOCAL oDlg
聽 聽 DEFINE DIALOG oDlg;
聽 聽 聽 聽 聽 聽TITLE REPLICATE( "X", 115 )
聽 聽 ACTIVATE DIALOG oDlg;
聽 聽 聽 聽 聽 聽 聽CENTER
聽 聽 RETURN NIL
The following sample demonstrates the problem. It doesn't show the dialog (tested under Win 8.1). It works correctly with a title up to 114 characters. In dialog.prg there is a check for maximum size of 140 characters. It should be lower to 114.

Cristobal,
are you using Win 8.1 64 bit? If yes, can you send me your EXE to test it here?
EMG
Enrico
I've sent you an email
Cristobal,
received and already answered! ![]()
EMG
Enrico Maria Giordano wrote:Cristobal,
received and already answered!
EMG
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg;
// TITLE REPLICATE( "X", 115 )
// oDlg:cCaption = REPLICATE( "X", 115 )
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetText( REPLICATE( "X", 500 ) );
CENTER
RETURN NILI traced the problem. It seems to be inside cDlg2Chr() function, probably in the calculation of wSize. But I guess we have to wait for Antonio to fix this.
EMG
DEFINE DIALOG oDlg TITLE REPLICATE( "X", 415 )聽 聽 DEFINE DIALOG oDlg //TITLE REPLICATE( "X", 415 )
聽 聽 oDlg:cCaption = REPLICATE( "X", 415 )#include "Fivewin.ch"
FUNCTION MAIN()
聽 聽 LOCAL oDlg
聽 聽 DEFINE DIALOG oDlg //TITLE REPLICATE( "X", 415 )
聽 聽 //oDlg:cCaption = REPLICATE( "X", 415 )
聽 聽 ACTIVATE DIALOG oDlg;
聽 聽 聽 聽 聽 聽 聽ON INIT oDlg:SetText( REPLICATE( "X", 500 ) );
聽 聽 聽 聽 聽 聽 聽VALID (Msginfo( Len( oDlg:cCaption ) ), .T. );
聽 聽 聽 聽 聽 聽 聽CENTER
聽 聽 RETURN NIL聽 聽if ::bInit != nil
聽 聽 聽 lResult = Eval( ::bInit, Self )
聽 聽 聽 if ValType( lResult ) == "L" .and. ! lResult
聽 聽 聽 聽 聽lFocus = .f.
聽 聽 聽 endif
聽 聽endif
// Add
聽 if len( ::cCaption ) > 140
聽 聽 聽::cCaption := Left( ::cCaption , 140 )
聽 聽 聽::SetText( ::cCaption )
聽 endifCristobal,
The third case works fine so the problem is not related to the length checking. As I already wrote, the problem is in cDlg2Chr() function. Once it is fixed, we can probably remove the length checking.
EMG
Enrico
If I had understood what you have written
My proposal is a temporary solution
I've already tried
Cristobal,
We need of a real solution.
EMG
Found! It seems that the correct solution is:
WORD wSize = sizeof( DIALOG_RES ) + ( hb_parclen( 6 ) * 2 ) +
1 + 2 + ( hb_parclen( 9 ) * 2 ) + 3 + 1;
Please note the + 1 at the end of the line. With it I can use a title of 10000 characters without problems! ![]()
EMG
Enrico
Great, fine
Enrico Maria Giordano wrote:Found! It seems that the correct solution is:
WORD wSize = sizeof( DIALOG_RES ) + ( hb_parclen( 6 ) * 2 ) +
1 + 2 + ( hb_parclen( 9 ) * 2 ) + 3 + 1;
Please note the + 1 at the end of the line. With it I can use a title of 10000 characters without problems!
EMG