I am trying to add 4 strings:
int errorCode = m_mybox.AddString(L"Jean");
errorCode = m_mybox.AddString(L"Joseph");
errorCode = m_mybox.AddString(L"Natasha");
errorCode = m_mybox.AddString(L"Daniel");
The error codes are 0 for all except the 3rd string, which has an error code
of -2. After adding the 4 strings, I check the number of strings in the
combo box, and it is 4. I have even retrieved a few of the strings out of the
combo box, and they look OK.
However, the dialog box is actually displayed, using DoModal(), none of the 4
strings in the combo box is visible.
Has anyone ever seen anything like this? I would be very grateful for any
suggestions.
I am using VC4.2 with UNICODE on Windows NT 4.0.
Jean Libera
jli...@mcs.com
Hi Jean,
This is a trap many of us have climbed out of... In the resource editor
click on the down arrow of the combo box and you can set a size for the
drop down portion of the combo box.
Good luck.
Rail
Oceanway Recording
rai...@earthlink.net
My only suggestion is that you read the documentation more carefully.
The return value from the "AddString" command is NOT, in general, an
error code!
Chris
----------------------------------------------------------------
Chris Marriott, SkyMap Software, U.K. e-mail: ch...@skymap.com
Creators of fine astronomy software for Windows.
For full details, visit our web site at http://www.skymap.com
>suggestions.
1. .AddString() returns the zero-based index to the string you added, or
CB_ERR/CB_ERRSPACE if an error occurs. So it does not always return error
code. Please refer to the VC online book.
2. Please check the size of your Combobox, be sure that it is enough to
show all your strings.
3. Put base dialog class's OnInitDialog() first during your own method.
Like below:
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
... // puts your codes here
return TRUE;
}
Good luck.
--
Shen Wenjun
Dept. of Physics, Fudan University, Shanghai 200433, P.R.C.
wjs...@fudan.edu.cn
It seems that when you are using the resource editor, if you click in the text-entry
portion of the list box, you get selection handles which allow you to adjust the
width of the combo box. If you click on the down arrow at the far right, you get
selection handles which allow you to adjust the height of the drop down part of the
list box.
Thanks again!
Jean Libera