问题描述
我想实现自动提示一个comboxbox(WIN32,C ++)或编辑控件。但我不知道如何正确使用接口IAutoComplete。我需要的地方,建议汽车应采取的匹配字符串的自定义列表。但如何与IEnumString实现这个?我发现这个链接,但它不和盘托出:的
I am trying to implement auto-suggest for a comboxbox (win32, c++) or an edit-control. But I dont know how to use the interface IAutoComplete correctly. I need a custom list of strings where the matches for auto-suggest should be taken from. But how to implement this with IEnumString? I found this link but it doesnt reveal everything: http://msdn.microsoft.com/en-us/library/windows/desktop/hh127437%28v=vs.85%29.aspx
有没有人实现过这个?
Thx提前
迈克尔
Has anybody ever implemented this?Thx in advanceMichael
推荐答案
正如我在我的评论指出,ATL有你一pre-写的。
As I noted in my comment, ATL has one pre-written for you.
typedef CComEnum<IEnumString,
&IID_IEnumString,
LPOLESTR,
_Copy<LPOLESTR> > CComEnumString;
CComObject<CComEnumString> *pes;
HRESULT hr = CComObject<CComEnumString>::CreateInstance(&pes);
这code基本上是从的。
That code was basically stolen from the CComEnum documentation.
这篇关于与IEnumString IAutoComplete自定义源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!