Quicken 2000 / edit.c MakeFit() bug...

Carl Sopchak carl.sopchak at cegis123.com
Mon Nov 11 08:38:08 CST 2002

I'm having the following problem with Quicken 2000 Deluxe under wine (CVS as 
of Thursday morning [and all prior versions]):

When I open an investment account, then click on the security name in an 
existing transaction, and that security name is fairly long (say, 20+ 
characters), the name gets replaced by the trandaction date!  This does not 
happen with MS Windows.

(Before I go any farther, I must say that I know virtually NOTHING about 
windows programming, and only a small bit more about Wine coding and 

After spending two days drudging through --debugmsg +all logs, I think I have 
a pretty good idea what's happening.  It appears that Quicken uses a single 
Edit Control for all of it's input fields.  When the account is opened, the 
initial editable field is the date of a new transaction.  Quicken sets the 
maximum input length (with EM_LIMITTEXT) to 10.  (Makes sense for a date...)  
This sets buffer_limit in it's EDITSTATE to 10.

Now, when you then go and click on the security name in that existing 
transaction, Quicken uses WM_SETTEXT to set it's value.  Under Wine, this 
fails, because the size of the string is greater than es->buffer_limit 
(checked near the top of EDIT_MakeFit() in controls/edit.c).  Now, 
EDIT_MakeFit() does notify Quicken with EN_MAXTEXT, but Quicken doesn't seem 
to respond in any sensible manner (like getting a bigger control and trying 
again).  (I have not followed this path past this point, but I know that the 
security name gets wiped out...)  Quicken will, AFTER issuing the SETTEXT, 
try to re-size the field with EM_LIMITTEXT to 30, a security name length.

I quote from MSDN (EM_LIMITTEXT Message Remarks section):
"The EM_LIMITTEXT message limits only the text the user can enter. It does not 
affect any text already in the edit control when the message is sent, nor 
does it affect the length of the text copied to the edit control by the 
WM_SETTEXT message. If an application uses the WM_SETTEXT message to place 
more text into an edit control than is specified in the EM_LIMITTEXT message, 
the user can edit the entire contents of the edit control. "

So, according to MSDN, the WM_SETTEXT should successfully set the text to the 
full length, regardless of the value of buffer_limit.

I am in the process of making this change and testing it.  I guess my main 
concern at this point is, "Are there any other ramifications to making this 
change that I should be concerned about?"  If anyone wants to point me in a 
direction here, I'll follow through...


More information about the wine-devel mailing list