Click here to Skip to main content
15,887,676 members
Articles / Desktop Programming / WTL

AutoCompleteML - auto completion for multiline edit box

Rate me:
Please Sign up or sign in to vote.
3.80/5 (6 votes)
14 Oct 20044 min read 50.3K   1.6K   29  
COM object for easy user input in multiline edit boxes
// acmpl.idl : IDL source for acmpl.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (acmpl.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

	typedef enum ACMLFlags {
		ACML_AutoSuggest = 1,
		ACML_AutoAppend = 2,
		ACML_UpDownKeyDropList = 4,

		// new flags
		ACML_ToolTip = 8,
		ACML_EnableUserAutoAdd = 16,
		ACML_EnableUserDelete = 32
	} ACMLFlags;


	[
		object,
		uuid(6C67284B-13D8-491F-A64C-B5779929382C),
		dual,
		helpstring("IAutoCompleteML Interface"),
		pointer_default(unique)
	]
	interface IAutoCompleteML : IDispatch
	{
		[id(1), helpstring("method Init")] HRESULT Init([in] long hwndEdit, [in] IUnknown *punkACL);
		[propget, id(3), helpstring("property Options")] HRESULT Options([out, retval] ACMLFlags *pVal);
		[propput, id(3), helpstring("property Options")] HRESULT Options([in] ACMLFlags newVal);
		[propget, id(4), helpstring("property ItemMaxLines")] HRESULT ItemMaxLines([out, retval] long *pVal);
		[propput, id(4), helpstring("property ItemMaxLines")] HRESULT ItemMaxLines([in] long newVal);
		[propget, id(5), helpstring("property Enabled")] HRESULT Enabled([out, retval] VARIANT_BOOL *pVal);
		[propput, id(5), helpstring("property Enabled")] HRESULT Enabled([in] VARIANT_BOOL newVal);
	};
	[
		object,
		uuid(C1756B99-D029-4AFF-9757-DE4E52C0E59C),
		dual,
		helpstring("IStringStorage Interface"),
		pointer_default(unique)
	]
	interface IStringStorage : IDispatch
	{
		[id(1), helpstring("method Add")] HRESULT Add([in] BSTR Item, [in,defaultvalue(0)] VARIANT_BOOL Sort);
		[id(2), helpstring("method LoadPrivateProfile")] HRESULT LoadPrivateProfile([in] BSTR File, [in] BSTR Section);
		[id(3), helpstring("method LoadXML")] HRESULT LoadXML([in] VARIANT Source);
		[id(4), helpstring("method SavePrivateProfile")] HRESULT SavePrivateProfile([in, defaultvalue("")] BSTR File, [in, defaultvalue("")] BSTR Section);
		[id(5), helpstring("method SaveXML")] HRESULT SaveXML([in] VARIANT Destination);
		[id(6), helpstring("method Delete")] HRESULT Delete([in] BSTR Item);
		[id(7), helpstring("method Clear")] HRESULT Clear();
	};

[
	uuid(5107C320-F17C-4F1D-B1EA-9E4E26B194E3),
	version(1.0),
	helpstring("acmpl 1.0 Type Library")
]
library ACMPLLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(66E47378-9BB6-4015-A6E2-AE179F5794D8),
		helpstring("AutoCompleteML Class")
	]
	coclass AutoCompleteML
	{
		[default] interface IAutoCompleteML;
	};
	[
		uuid(32B2F078-4331-4ED9-BA94-19FA3C9DECEE),
		helpstring("StringStorage Class")
	]
	coclass StringStorage
	{
		[default] interface IStringStorage;
	};
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions