OLEapt: OLE Apartment Model Threading

Click to open or copy the OLEapt project files.

The OLEapt sample demonstrates OLE apartment model threading. The term "apartment" describes a thread with a message queue that supports OLE/COM objects. Objects within an apartment are re-entrant in only the traditional Windows sense, similar to single-threaded OLE. Therefore, operations that yield to the message queue can cause further messages to be sent to any objects within the apartment. Apartment model threading allows there to be more than one "apartment" where previously there was only one: the main application thread.

Building SDK Samples

This sample uses the following keywords:

addref; beginpaint; cclassfactory; cobject; cocreateinstance; coinitialize; comarshalinterface; coregisterclassobject; corevokeclassobject; couninitialize; counmarshalinterface; createevent; createinstance; createstreamonhglobal; createthread; createwindow; define_guid; defwindowproc; dispatchmessage; endpaint; failed; fautoregister; getcurrentthreadid; getlasterror; getmessage; getmodulefilename; hbrush; invalidaterect; loadcursor; loadicon; lockserver; lstrcpy; lstrlen; mainwndproc; memset; messagebeep; messagebox; msgwaitformultipleobjects; peekmessage; postquitmessage; queryinterface; regclosekey; regcreatekey; registerclass; regsetvalue; release; resumethread; seek; serverthreadproc; setevent; showwindow; stdmethodimp_; strcmpi; strtok; text; textout; translatemessage; waitforsingleobject; winmain; wsprintf