PDA

View Full Version : Text string limit on a dialog



Brandon Lowe
06-09-2004, 04:34 PM
I have a dialog that I have changed the string on in the DLL and now when it displays I get a message that the STR is over limit. What is the limit of those strings? This same dialog worked fine in version 7.05.

Thanks
Brandon

dbriggs
06-11-2004, 01:21 PM
I've got a feeling it's 256 bytes, including a trailing NULL. That would be a Windows restriction, not IS.

Hope that helps,

David

Brandon Lowe
06-11-2004, 03:02 PM
I do not think it is a windows limit because if you look at my other post I show you the screen shots and it was working fine with version 7 and then when I upgraded the install project to X I started to get the over limit message. I'm on the same machine and the dialog works fine if run with 7 but fails with X.

http://community.installshield.com/showthread.php?s=&threadid=134524

Follow that link and scroll down and you will see what I'm talking about. So far it goes unanswered from any of the installshield people that watch this message board.

Brandon

Brandon Lowe
06-11-2004, 03:07 PM
One more thing, Yes it is well over 255 but I'm not sending the string to the dialog. It is a static text block put on the dialog using a resource editor on the _ISUser.dll file.

Brandon

dbriggs
06-14-2004, 07:33 AM
Of course it's easy enough to test the length limit. Looking at your other thread, it looks like you are using a Skin in ISX. I wonder whether that is responsible for the error. If so, you could revert to a non-skinned dialog (the original looks fine to me $;-) or else split the paragraphs up and create a couple of new controls.

Hope that helps,

David

Brandon Lowe
06-14-2004, 09:03 AM
I figure my only answer is to split the text up into more than 1 text box. I just would like to know what they changed. Like I said it worked great in previous versions and now it does not work, so they have changed something and not for the better.

Brandon

Brandon Lowe
06-14-2004, 10:25 AM
Ok here is another small piece of information.
The dialog is just the AskOptions dialog modified to have the text on it that I want. If you go into the dialog editor in ISPro X it shows the text as I want it. But if you edit the compiled _ISUser1033.res file it shows the over limit message. Now I can edit that file with a .net resorce editor and it is fine until ISPro X compiles it again and then it has the over limit message.

Brandon

dbriggs
06-14-2004, 10:55 AM
Can you feed the long text in using run-time variable parameters?

AskOptions seems to have several szTextx parameters. These are limited to 47 characters in DS9, so maybe not.

David

Brandon Lowe
06-14-2004, 11:52 AM
Ok here is another small piece of information.
The dialog is just the AskOptions dialog modified to have the text on it that I want. If you go into the dialog editor in ISPro X it shows the text as I want it. But if you edit the compiled _ISUser1033.res file it shows the over limit message. Now I can edit that file with a .net resorce editor and it is fine until ISPro X compiles it again and then it has the over limit message.

Brandon

will_514
03-17-2008, 04:45 PM
I've just run across this error in IS 12 and IS 2008.

My SdFinishReboot dialog has a 365+ character string in the szMsg1 text box.

If the string is passed in as the second parameter of the SdFinishReboot() call, the string gets displayed, but is truncated.

If the default string is used by passing "" as the second parameter of the SdFinishReboot() call, the error message is displayed. The default string is the same as the one passed in.

I think the limit for characters in a text box is about 365.

dbriggs
03-18-2008, 05:57 AM
365 characters seems a lot, about 73 words at an average of 5 characters per word. It is 3 times the default message length. Now, if you are translating, French particularly can double your word count, so it is worth thinking if you can re-word the message to be shorter. For example, I changed szMsg1 to:


Setup has finished copying files, but it is necessary to restart Windows before %P can be used.

which is 17 words, 96 characters before the %P replacements. The French version of this text is:


Le programme d'installation a terminé de copier les fichiers, mais vous devez redémarrer Windows pour pouvoir utiliser %P.

which is 123 characters. See how "Setup" got translated into "Le programme d'installation"! You may not have a problem with translations, but that doesn't mean you can get away with long messages.

My version of SdFinishReboot has 59 * 349 dialog units for the height and width respectively of szMsg1 and 2 controls. I don't remember whether I have stretched them already. I may have, to fill up the available space and allow for long translations. With these dimensions, they will hold about 6 lines each at the usual text size, but you should be aware that users will not always read this much text (twice) before clicking the Next or Finish button, so anything important needs to be written clearly and succinctly (like this isn't, but I'm hoping you're still reading $;-). For example, in the above message, you could get by without "Setup has finished copying files, but" and even "before %P can be used"!

If you really have to display a big message, you can put up a message dialog immediately afterwards, but only if the user chose not to reboot straight away...

Hope that helps,

David