Click here to Skip to main content
15,906,081 members
Home / Discussions / COM
   

COM

 
GeneralWTL, Attila, Windowing Pin
26-Apr-01 8:19
suss26-Apr-01 8:19 
GeneralATL/COM and #import directive Pin
25-Apr-01 6:48
suss25-Apr-01 6:48 
GeneralRe: ATL/COM and #import directive Pin
Joseph Dempsey30-Apr-01 7:34
Joseph Dempsey30-Apr-01 7:34 
GeneralRe: ATL/COM and #import directive Pin
Ryan Park2-May-01 8:18
Ryan Park2-May-01 8:18 
GeneralRe: ATL/COM and #import directive Pin
SuperGeek2-May-01 9:09
SuperGeek2-May-01 9:09 
GeneralDCOM Server with UI Pin
Tony Li24-Apr-01 10:03
Tony Li24-Apr-01 10:03 
GeneralSerialize calls to a COM object in a single threaded model Pin
23-Apr-01 6:42
suss23-Apr-01 6:42 
GeneralRe: Serialize calls to a COM object in a single threaded model Pin
SuperGeek25-Apr-01 7:09
SuperGeek25-Apr-01 7:09 
If you are using ATL, try to use CComCriticalSection object. Create the data member of that type in your class and initialize it in your object's constructor. Use CComCriticalSection::Lock() and Use CComCriticalSection::Unlock() methods in code blocks that require only-one-at-a-time execution (a.k.a. serialized access or thread-safe code). This object is well documented in MSDN library. The alternative to it is Win32 API:

CRITICAL_SECTION hMyCS;
InitializeCriticalSection(&hMyCS);
***
***
EnterCriticalSection(&hMyCS);
// your thread-safe code begings
***
***
***
// your thread-safe code ends
LeaveCriticalSection(&hMyCS);

As opposed to events, semaphores, and mutexes, critcal sections are the easiest and fastest synchronization objects.
Second, events, semaphores and mutexes are mostly used for inter-process syncrhonization and communication, but you still can use them at intra-process level.

When Critical Sections are used, all client threads that access your component will be automatically queued in First-Come-First-Served fashion. Windows and COM runtime will take care of that for you.

Hope you find it helpful.
Kirill Sherman
shermank@glstrat.com
GeneralRe: Serialize calls to a COM object in a single threaded model Pin
25-Apr-01 21:43
suss25-Apr-01 21:43 
GeneralRe: Serialize calls to a COM object in a single threaded model Pin
1-May-01 10:35
suss1-May-01 10:35 
GeneralWord 2000 Pin
DrunkerII20-Apr-01 9:26
DrunkerII20-Apr-01 9:26 
Question[string] atttribute ?? Pin
Glenn Wardius18-Apr-01 6:40
Glenn Wardius18-Apr-01 6:40 
AnswerRe: [string] atttribute ?? Pin
Joseph Dempsey30-Apr-01 7:38
Joseph Dempsey30-Apr-01 7:38 
GeneralProblem automating Access to run a report Pin
vtecman18-Apr-01 1:38
vtecman18-Apr-01 1:38 
GeneralBSTR arguments Pin
yamini16-Apr-01 20:38
yamini16-Apr-01 20:38 
GeneralRe: BSTR arguments Pin
Michael Dunn16-Apr-01 21:17
sitebuilderMichael Dunn16-Apr-01 21:17 
GeneralRe: BSTR arguments Pin
19-Apr-01 1:54
suss19-Apr-01 1:54 
GeneralRe: BSTR arguments Pin
19-Apr-01 1:56
suss19-Apr-01 1:56 
GeneralReturning an array of strings Pin
Pros Chum15-Apr-01 9:28
Pros Chum15-Apr-01 9:28 
Generalmystery about filtergraph Pin
13-Apr-01 22:55
suss13-Apr-01 22:55 
QuestionHow can I get a smart pointer to a COM object implemented in Java? Pin
Matt Philmon12-Apr-01 9:00
Matt Philmon12-Apr-01 9:00 
QuestionHow can I get a smart pointer to a COM object implemented in Java? Pin
Matt Philmon12-Apr-01 8:58
Matt Philmon12-Apr-01 8:58 
GeneralMaybe you will kill me, but... Pin
7-Apr-01 21:30
suss7-Apr-01 21:30 
GeneralRe: Maybe you will kill me, but... Pin
Michael Dunn12-Apr-01 13:37
sitebuilderMichael Dunn12-Apr-01 13:37 
QuestionCan ActiveX CAB file contain AddReg? Pin
6-Apr-01 2:57
suss6-Apr-01 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.