Click here to Skip to main content
15,879,490 members
Articles / Desktop Programming / ATL

Understanding The COM Single-Threaded Apartment Part 2

Rate me:
Please Sign up or sign in to vote.
4.90/5 (57 votes)
18 Feb 2005CPOL71 min read 255.8K   2.2K   169  
Learn the fundamental principles of the COM Single-Threaded Apartment Model by code examples.
// stdafx.h : include file for standard system include files,
//      or project specific include files that are used frequently,
//      but are changed infrequently

#if !defined(AFX_STDAFX_H__E44A71C1_F36D_4C5D_8FA0_7FCCA7BD0E95__INCLUDED_)
#define AFX_STDAFX_H__E44A71C1_F36D_4C5D_8FA0_7FCCA7BD0E95__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#define _ATL_APARTMENT_THREADED

#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__E44A71C1_F36D_4C5D_8FA0_7FCCA7BD0E95__INCLUDED)

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
Systems Engineer NEC
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.

Comments and Discussions