|
-
Sep 1st, 2001, 12:38 AM
#1
Thread Starter
PowerPoster
AutoCompelete feature
Hi, I can use a kind of auto complete in the combobox box look at the following line:
PHP Code:
int theindex;
theindex = SendMessage(cbhwnd, CB_FINDSTRING, (WPARAM)-1, (LPARAM)(LPCSTR)"C:")
When I read the value of "theindex" I get some large number like "20101201020" what is that? Should not it return a real index number like 0,1, or 2 in the combobox?
-
Sep 1st, 2001, 06:01 AM
#2
Frenzied Member
The return value is the zero-based index of the matching item. If the search is unsuccessful, it is CB_ERR.
Have you checked that that number is not the CB_ERR.
-
Sep 1st, 2001, 10:31 AM
#3
Thread Starter
PowerPoster
i used itoa to convert the number to a string and then show a messagebox like this:
PHP Code:
char buffer[100];
itoa(theindex, buffer, 20);
MessageBox(NULL,buffer,"Hi",MB_OK);
-
Sep 1st, 2001, 12:14 PM
#4
Frenzied Member
Why are you converting it to a string. Use
Code:
If(theIndex == CB_ERR)
//show error message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|