Click here to Skip to main content
15,893,668 members
Articles / Programming Languages / C++

COM in plain C, Part 6

Rate me:
Please Sign up or sign in to vote.
4.89/5 (32 votes)
22 Jul 2006CPOL25 min read 103.2K   2.4K   102  
How to write an ActiveX Script Host in C.
// The IDL file for IExample2.DLL
//
// {E1124082-5FCD-4a66-82A6-755E4D45A9FC} = Type library's GUID
// {520F4CFD-61C6-4eed-8004-C26D514D3D19} = IExample2 object's GUID
// {B6127C55-AC5F-4ba0-AFF6-7220C95EEF4D} = IExample2 VTable's GUID

[uuid(E1124082-5FCD-4a66-82A6-755E4D45A9FC), version(1.0), helpstring("IExample2 COM server")]
library IExample2
{
	importlib("STDOLE2.TLB");

	[uuid(B6127C55-AC5F-4ba0-AFF6-7220C95EEF4D), dual, oleautomation, hidden, nonextensible]
	interface IExample2Vtbl : IDispatch
	{
		[helpstring("Sets the test string.")]
		[id(1)] HRESULT SetString([in] BSTR str);
		[helpstring("Gets the test string.")]
		[id(2)] HRESULT GetString([out, retval] BSTR *strptr);
	}

	[uuid(520F4CFD-61C6-4eed-8004-C26D514D3D19), helpstring("IExample2 object."), appobject]
	coclass IExample2
	{
		[default] interface IExample2Vtbl;
	}
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


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

Comments and Discussions