Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Understanding The COM Single-Threaded Apartment Part 2

, 18 Feb 2005
Learn the fundamental principles of the COM Single-Threaded Apartment Model by code examples.
ccomthread2_src.zip
SimpleCOMObject1
SimpleCOMObject2
Test Programs
VBSTACOMObj
Shared
SimpleCOMObject1.def
SimpleCOMObject1.dsp
SimpleCOMObject1.dsw
SimpleCOMObject1.rgs
SimpleCOMObject1ps.def
SimpleCOMObject1ps.mk
SimpleCOMObject1.tlb
SimpleCOMObject2.def
SimpleCOMObject2.dsp
SimpleCOMObject2.dsw
SimpleCOMObject2.rgs
SimpleCOMObject2ps.def
SimpleCOMObject2ps.mk
SimpleCOMObject2.tlb
VCTests
VBTest
DemonstrateSTAInterThreadMarshalling
VCTest02
VCTest01
VCTest02.dsp
VCTest02.dsw
VBSTACOMObj.tlh
VBSTACOMObj.tli
VCTest01.dsp
VCTest01.dsw
SimpleCOMObject2.tlh
SimpleCOMObject2.tli
FormMain.frm
VBTest.exe
VBTest.vbw
VBTest.vbp
VBSTACOMObj.dll
VBSTACOMObj.exp
VBSTACOMObj.lib
VBSTACOMObj.vbw
VBSTACOMObj.cls
VBSTACOMObj.vbp
// SimpleCOMObject2.idl : IDL source for SimpleCOMObject2.dll
//

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

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(8144D7D0-4516-4B64-AAE7-FA276C94D870),
		dual,
		helpstring("ISimpleCOMObject2 Interface"),
		pointer_default(unique)
	]
	interface ISimpleCOMObject2 : IDispatch
	{
		[id(1), helpstring("method TestMethod1")] HRESULT TestMethod1();
	};

[
	uuid(583B22E4-9E01-4FD3-B0CE-DD75916554BE),
	version(1.0),
	helpstring("SimpleCOMObject2 1.0 Type Library")
]
library SIMPLECOMOBJECT2Lib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(02CE2476-7F6D-4699-96D2-17FF53758221),
		helpstring("_ISimpleCOMObject2Events Interface")
	]
	dispinterface _ISimpleCOMObject2Events
	{
		properties:
		methods:
	};

	[
		uuid(993B1ECD-61D0-41D3-A4A9-293FB47F83FF),
		helpstring("SimpleCOMObject2 Class")
	]
	coclass SimpleCOMObject2
	{
		[default] interface ISimpleCOMObject2;
		[default, source] dispinterface _ISimpleCOMObject2Events;
	};
};

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)

Share

About the Author

Lim Bio Liong
Web Developer
Singapore Singapore
Lim Bio Liong is a Specialist at a leading Software House in Singapore.
 
Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.
 
Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.

| Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 19 Feb 2005
Article Copyright 2005 by Lim Bio Liong
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid