Read Only Edit Box Won't Update
Posted on 2006-10-22
I have a read only edit box that I'm trying to use to display a file-count in a dialog box when the dialog box opens.
As part of the initialization of the dialog box, some files are counted and I know that's working but I can't get the count-value to display in an edit box (either as an integer or as a string).
I even tried adding a button to manually force the program-calculated value into the dialog box. But the dialog box remains blank.
Articles on the subject seemed to break down into two categories:
1. Those which warn against using GetDlgItem, but then don't tell you how to use an alternative.
2. Those which warn against using UpdateData, but then don't tell you how to use an alternative.
I tried both methods, get no errors, and nothing displays in the edit box. Right now, I'm just trying to display: "test". Can't even do that.
Googling the subject is an exercise in bizarro world help, where the help exists only at the very beginning levels and what seems to me to be the much more advanced levels, with nothing in between.
And what's really bizarre is I actually solved this problem several years ago (I don't do all that much MFC programming) and the program I wrote actually worked using GetDlgItem, using a single parameter, but when I try to use GetDlgItem in my new program I get an error saying GetDlgItem doesn't take only one parameter. In both cases I was using Visual C++6.0. In fact, using the same installation of it on the same computer and it works in one program and not in another.
I'm not against using two parameters (the first one being a handle), but I have no idea how to do it, or how to find help with it, since all help on the subject seems to assume that the reader already knows as much about handles as everybody else, or why I need it in one program and not in another.
Any help would be greatly appreciated.