Re: fire event & IUnknown

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: brian (brianfakemail_at_yahoo.com)
Date: 01/29/05


Date: Sat, 29 Jan 2005 10:29:48 +0100


> Is your client single-threaded or multi-threaded? Does switching
> the client's threading model change anything?
It is single-threaded - this is an ActiveX control. But my tests with C# and
VB were single-threaded as well (I hope).

All I've read about ActiveX components leads me to think that I should not
change its threading model.

> I suspect you have some kind of marshaling problem. How
> do you fire from the worker thread? I hope not directly,
> since that's most likely your problem right there. GIT would
> be most versatile.
Well, the worker thread is created with CreateThread routine. In the
controlling function I call CoInitializeEx(multi-threaded) before any call
to COM is made. However I call Fire_Onxxx directly. I mean I have a pointer
to the object (this pointer) and I call its methods. They are in form of
Onxxx functions. In one of this Onxxx methods I call Fire_Onxxx event.
Surprisingly all the rest events are successful, although they are fired
using the same mechanism, but the Fire_OnFrame event fails.

The server is multi threaded. The _ATL_FREE_THREADED macro is defined in
stdafx.h. The CComMultiThread is used in class declaration.

You are talking about GIT. Could you post any snippet here showing how to
use it? And one more question: wasn't it introduced first at Win2000?

Thanks.



Relevant Pages

  • Re: Threads, InvokeRequired & Form Controls
    ... Please note that the above link about .NET 3.0 describes the threading model of the 3.0-and-above framework, and won't work out of the box on 2.0 and below. ... I found something about Marshalling ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: x264 benchmarks BFS vs CFS
    ... We recently implemented a new threading model which may be ... The frame is split into X slices, ... Split up a ton of threads to do the main encode, ...
    (Linux-Kernel)
  • libpthread vs libthr.
    ... figure out why libthr in it current state is not our default posix ... the library by default is the source of a bad myth that threading model ... Another interesting question is which of the libraries will better work ...
    (freebsd-current)
  • Re: RealBasic, is it ready?
    ... That is because REALbasic uses a cooperative threading model (in ... they're known as "fibers") instead of a preemptive threading ... but that ease comes with pitfalls. ... For more information about cooperative vs preemptive threading models, ...
    (microsoft.public.vb.general.discussion)
  • Re: Threading Model Query
    ... your threading model is so it can generate proper IUnknown ... >> ATL Object Wizard are redundant for out of process servers? ... > Igor Tandetnik ...
    (microsoft.public.vc.atl)