Click here to Skip to main content
13,006,705 members (58,488 online)
Click here to Skip to main content
Add your own
alternative version


30 bookmarked
Posted 29 Jun 2003

Smart Auto-Complete (and Easy )

, 29 Jun 2003
Rate this:
Please Sign up or sign in to vote.
A Edit that Automatically completes your words


You must override the two virtuals.

  • bool OnSearch(LPCTSTR szFilter); // return true if found , false otherwise


  • void OnFillList(); //Use this virtual to fill "AutoComplete-List"

You must take care with settings like DelayTime, MinChars etc. See the header files for more information

Code Listing

class CAutoIni : public CAutoEdit  
    void DeleteString(LPCSTR szKey);
    int AddString(LPCSTR szEntry);
    virtual bool OnSearch(LPCTSTR szFilter);
    virtual ~CAutoIni();
    int m_iMaxKeys;
    CString m_strSectionName;// set the section for .ini or reg
    CString m_strNumItemsKey;// if not set: default is "NumItens"
    CString m_strItemDataKey;// if not set: default is "Item"
    inline void SetKeyNumItem(LPCTSTR szKeyName)
        m_strNumItemsKey = szKeyName;

    inline CString GetKeyNumItem()
        return m_strNumItemsKey;

    inline void SetMaxKeys(int iMax)

    inline int GetMaxKeys()
        return m_iMaxKeys;

    inline void SetItemKey(LPCTSTR szItemKey)
        m_strItemDataKey = szItemKey;

    inline CString GetItemKey()
        return m_strItemDataKey;




    virtual void OnFillList();


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Vinicius Jarina
Software Developer (Senior)
Brazil Brazil
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralNot bad! Pin
John R. Shaw11-Jul-03 14:24
memberJohn R. Shaw11-Jul-03 14:24 
GeneralRe: Not bad! Pin
LPVOID _vjocall Vinicius28-Jul-03 19:03
memberLPVOID _vjocall Vinicius28-Jul-03 19:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170628.1 | Last Updated 30 Jun 2003
Article Copyright 2003 by Vinicius Jarina
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid