Bug in TDialog title [Solved]

Re: Bug in TDialog title

Postby cnavarro » Sat Feb 15, 2014 10:17 pm

Enrico
Creo que no he entendido bien tu problema:
A.- Quieres un caption con mas de 140 caracteres
B.- Controlar que el caption no tengas mas de 140 caracteres
Yo habia entendido la opcion B
Tengo un gran problema con el idioma ingles

Enrico
I think I misunderstood your problem:
A. - You want a caption with more than 140 characters
B. - Check that the caption does not have more than 140 characters
I had understood the option B
I have a big problem with the English language
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Sat Feb 15, 2014 10:59 pm

Cristobal,

cnavarro wrote:Enrico
I think I misunderstood your problem:
A. - You want a caption with more than 140 characters
B. - Check that the caption does not have more than 140 characters


No, the problem is that there is no such limit in the size of a dialog title (Windows API docs don't mention any limits). The current limit is only the result of a bug in cDlg2Chr() function. At least this is what I understood.

Is it more clear now? :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby cnavarro » Sun Feb 16, 2014 12:05 am

Si, ahora me ha quedado muy muy claro
Gracias

Yes, it has now become very clear to me
thanks
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug in TDialog title

Postby Daniel Garcia-Gil » Sun Feb 16, 2014 1:55 pm

Enrico

try with

wLen += ( iLenUnicode * 2 ) + 1;
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Sun Feb 16, 2014 2:14 pm

Daniel,

Daniel Garcia-Gil wrote:Enrico

try with

wLen += ( iLenUnicode * 2 ) + 1;


I now get:

hb_xrealloc can't reallocate memory

:-(

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Daniel Garcia-Gil » Sun Feb 16, 2014 3:02 pm

what C compiler are you using?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Sun Feb 16, 2014 3:19 pm

Daniel,

Daniel Garcia-Gil wrote:what C compiler are you using?


BCC582

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Sun Feb 16, 2014 3:35 pm

Daniel,

Daniel Garcia-Gil wrote:Enrico

try with

wLen += ( iLenUnicode * 2 ) + 1;


With

Code: Select all  Expand view
wLen += iLenUnicode;


it seems to work fine. What is your opinion about this possible fix?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Daniel Garcia-Gil » Mon Feb 17, 2014 10:07 am

Enrico Maria Giordano wrote:CODE: SELECT ALL  EXPAND VIEW
wLen += iLenUnicode;


it seems to work fine. What is your opinion about this possible fix?


if work is fine ;-)
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Mon Feb 17, 2014 10:56 am

Daniel,

Daniel Garcia-Gil wrote:
Enrico Maria Giordano wrote:CODE: SELECT ALL  EXPAND VIEW
wLen += iLenUnicode;


it seems to work fine. What is your opinion about this possible fix?


if work is fine ;-)


The problem is that I don't understand the code of cDlg2Chr() function very well so I found that "fix" with trial and error. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Daniel Garcia-Gil » Mon Feb 17, 2014 10:24 pm

Enrico

we are filling a DLGTEMPLATE structure, is used like argument in the function CreateDialogIndirect...

check DLGTEMPLATE structure remark section
In a standard template for a dialog box, the DLGTEMPLATE structure is always immediately followed by three variable-length arrays that specify the menu, class, and title for the dialog box. When the DS_SETFONT style is specified, these arrays are also followed by a 16-bit value specifying point size and another variable-length array specifying a typeface name. Each array consists of one or more 16-bit elements. The menu, class, title, and font arrays must be aligned on WORD boundaries.
...
Following the class array is a title array that specifies a null-terminated Unicode string that contains the title of the dialog box. If the first element of this array is 0x0000, the dialog box has no title and the array has no other elements.
...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Mon Feb 17, 2014 10:40 pm

Daniel,

So what? Are you trying to say that my "fix" can be correct? :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Daniel Garcia-Gil » Tue Feb 18, 2014 12:51 am

Enrico Maria Giordano wrote:Daniel,

So what? Are you trying to say that my "fix" can be correct? :-)

EMG


no i'm trying explain you...

Enrico Maria Giordano wrote:The problem is that I don't understand the code of cDlg2Chr() function very well so I found that "fix" with trial and error.
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Tue Feb 18, 2014 9:53 am

Daniel,

Daniel Garcia-Gil wrote:no i'm trying explain you...


Ok. :-)

At the moment, I'm convinced that iLenUnicode doesn't have to double (*2) but I would hear your opinion.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TDialog title

Postby Enrico Maria Giordano » Tue Feb 25, 2014 9:33 am

I'm testing my fix and found no problem so far. The fix is:

replace

Code: Select all  Expand view
wLen += ( iLenUnicode * 2 );


with

Code: Select all  Expand view
wLen += iLenUnicode;


in dlg2chr.c.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

PreviousNext

Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 5 guests