Re: Thread-safety in VB+MFC Nested ActiveX controls

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thank you Alexander for your response. Mine is MTA client (FREE_THREADED).
Do you recommend to use STA if possible instead of MTA? The exceptions I see
are as follows: Noe that _vbaRaiseEvent is causing an exception (ActiveX is
written in VB) Any help?

__vbaRaiseEvent+I64X11009C2A 013AF140
DllCanUnloadNow+I64X779D7D5D 013AF15C
DispCallFunc+I64X6A9FA2FB 013AFAB8
BASIC_CLASS_Invoke+I64X6AAA6772 013AFAF8
BASIC_DISPINTERFACE_GetTypeInfo+I64X6AAA68E1 013AFB28
EVENT_SINK_Invoke+I64X6C3FBF05 013AFBCC Ordinal4036+I64X6C3856CB 013AFC1C
Ordinal2797+I64X6C38571D 013AFCC0 Ordinal2795+I64X6C3B99D5 013AFCE0
Ordinal6374+I64X6C384680 013AFD08 Ordinal6370+I64X6C3B88EE 013AFD68
Ordinal1109+I64X6C3B8AFB 013AFD88 Ordinal1578+I64X09B02E54 013AFDB4
DllUnregisterServer+I64X77E3A420 013AFDD4
SetWindowPlacement+I64X77E14605 013AFE60
TranslateMessageEx+I64X77E15B77 013AFFB4
DispatchMessageA+I64X7C57B388 01


"Alexander Nickolov" wrote:

> I hope by multithreaded client you mean a client that creates
> mulktiple STAs. E.g. not a client using MTA.
>
> I'd start doing real debugging. Nothing in your post suggests
> where there might be a problem, though the client is the
> place I'd start with first.
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@xxxxxxxx
> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================
>
> ".Suchit" <Suchit@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:7C3031DB-6A87-4EFE-B66E-F338DAFA2C41@xxxxxxxxxxxxxxxx
> > Hi All,
> >
> > Not sure about thread-safety issues & can following scenario work well:
> >
> > Let's give some names:
> > (1) VB1 = Visual Basic 6.0 ActiveX control, non-windowless, threading
> > model
> > Apartment
> > (2) Cls[..] = array of VB 6.0 Class module maintained inside above ActiveX
> > control (VB1)
> > (3) MFC1 = MFC 6.0 ActiveX control, non-windowless, threading model
> > Apartment
> >
> > Now from a multi-threaded client application, using GIT we are sending
> > calls
> > to VB1. VB1 internally maintains one instance in Cls[..] array per thread.
> > This array element again creates one instance of MFC1 control and
> > subscribes
> > to its events.
> >
> > Now when MFC1 generates an event, the member of Cls[..] array calls a
> > method
> > of VB1 parent control. Cls[..] members and VB1 are runtime-late-bound
> > using
> > Object in VB. Static binding does not work. (this is anotehr strange
> > problem)
> >
> > Now when methods of VB1 are called by Cls[..] member elements, this VB1
> > generates events which are sink-ed by multi-threaded client.
> >
> > This application works well for 10-15 minutes and suddenly generates an
> > error:
> > Method '~' of object '~' failed.
> >
> > Is this scenario Thread-Safe? What could be a potential source of
> > problems?
> > Should I try maintaining a queue in VB1 for receiving event sinks (instead
> > of
> > calling methids directly from Cls[...] objects)? Unfortunately in this
> > forum
> > I don't know how to attach a diagram. I have a good diagram that explains
> > the
> > visually nesting of our components.
> >
> > Any help would be great.
>
>
>
.



Relevant Pages

  • Re: Getting events from C++?
    ... Your object is not any different from a normal MTA client. ... > I'm building a MTA object on top of a STA object. ...
    (microsoft.public.vc.atl)
  • Re: About undisclosed recipient
    ... > As I indicated in my link to the RFC, any "white space", i.e., a blank space ... Same MTA, different clients connecting, different results. ... MTA "client aware", and inserting different results by client? ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • MTA closing connection after 552 response
    ... What is considered the proper thing for an MTA to do when a client ... sends more than an allowed amount of content in the DATA portion of an ... After receiving a QUIT command and responding with a 221 reply. ...
    (comp.mail.misc)
  • Re: marshalling
    ... Are you sure that the server is an out-of-proc server? ... But now that the client is MTA, marshalling kicks ...
    (microsoft.public.vc.atl)
  • Re: Finalizer Queue
    ... The COM client which ... until the finalizer thread has run the "finalize" on the RCW. ... The most obvious solution is to le the client thread join the MTA ... you will have to implement deterministic destruction of the .NET object, ...
    (microsoft.public.dotnet.languages.csharp)