Results 1 to 4 of 4

Thread: AutoCompelete feature

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    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(cbhwndCB_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?
    Baaaaaaaaah

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    i used itoa to convert the number to a string and then show a messagebox like this:

    PHP Code:
    char buffer[100];
    itoa(theindexbuffer20);
    MessageBox(NULL,buffer,"Hi",MB_OK); 
    Baaaaaaaaah

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Why are you converting it to a string. Use
    Code:
    If(theIndex == CB_ERR)
    //show error message
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width