Re: fire event & IUnknown

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 01/28/05


Date: Fri, 28 Jan 2005 09:33:57 -0800

Is your client single-threaded or multi-threaded? Does switching
the client's threading model change anything?

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.

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"brian" <brianfakemail@yahoo.com> wrote in message 
news:1106917366.549668.153410@z14g2000cwz.googlegroups.com...
>> Try providing an explicit _ATL_FUNC_INFO structure with
>> SINK_ENTRY_INFO instead of SINK_ENTRY_EX.
> Does not work.
>
> But I've gotten further. Really the problem is the multi-threaded
> apartment. I have created a test solution. It contains one server and
> one client ATL projects. The client project consists of one ATL ActiveX
> object - the sink. The server project consists of two objects. The
> first object is a single-threaded ATL simple object. The second one is
> a multi-threaded ATL simple object. They both have their own trigger
> method with exactly the same implementation.
>
> The client creates and advises them.
>
> In the test container:
> - the triggered event from STA object is successfully handled within
> the client;
> - triggering the event from MTA object failed with E_UNEXPECTED.
>
> So, the threading model is causing the event to fail. However I am
> really curious why the rest events have been successfully fired from my
> original multi-threaded object (refer my previous posts) and only this
> one (with IPictureDisp interface pointer) has failed.
>
> My question now is how to work around this limitation, since:
> - I do need worker threads, thus I have to use multi-threaded
> apartment;
> - I do need to fire events from within worker threads;
> - finally I do need to use IPictureDisp or similar interface.
> Any further tips are appreciated.
> Thanks.
> 


Relevant Pages

  • Re: .NET 2.0 Remoting Bug?
    ... I am not entirely aware of all the remoting interals and threading issues, ... (identification only, I don't want to impersonate the client), and I ... Apparently Thread.CurrentPrincipal is set to a GenericEntity type ...
    (microsoft.public.dotnet.security)
  • RE: Maintaining State Between Web Pages
    ... The srever runs on the client machine. ... I used Apartment threading model. ... so creating multiple instances results in launching multiple ... You must protect instance data as well as global memory. ...
    (microsoft.public.scripting.vbscript)
  • Re: Thread-Problem
    ... warum ich im nachfolgenden Beispiel ich ... > Threading hat noch andere Bedingungen, ... ausgeführt, in einem anderen überprüft, ob die Verbindung zum Client noch ... ein gutes Buch über Multithreading-Grundlagen. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Need Mechanism or code for wait state in asp.net web application
    ... You don't want to go anywhere near the threading classes for this one, ... You need to perform actions on the client, ... >to display user a cursor and also put application in wait state that user ... I want to add wait cursor code whenever page is post back. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Threading in C#.Net Web application
    ... web server vs. clients browser. ... I have seen some "successful" implementation of threading in web ... mix of client and server side script, ...
    (microsoft.public.dotnet.languages.csharp)