Re: atl and threads
From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 03/31/04
- Next message: Brian Muth: "Re: Accessing Singleton EXE COM Servers From Clients Running Under Different Accounts"
- Previous message: William Sonner: "Accessing Singleton EXE COM Servers From Clients Running Under Different Accounts"
- In reply to: udo polder: "Re: atl and threads"
- Next in thread: udo polder: "Re: atl and threads"
- Reply: udo polder: "Re: atl and threads"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 31 Mar 2004 11:01:31 -0800
I'm afraid I lost you here... You can call CreateWindow[Ex] from
within an interface method of an STA object. Or DialogBox[Indirect]
for that matter (which you know from wrapper classes' DoModal).
In the latter case the dialog spins a modal loop and your method
won't return to the caller until the dialog is dismissed, however
you can call back to the client, and the client can call your object
nested within the modal dialog displaying method call. beyond this,
I don't understand what you are trying to do...
-- ===================================== Alexander Nickolov Microsoft MVP [VC], MCSD email: agnickolov@mvps.org MVP VC FAQ: http://www.mvps.org/vcfaq ===================================== "udo polder" <polder_udo@yahoo.com> wrote in message news:1dbf63f8.0403302312.2071c16@posting.google.com... > i know i did it wrong thats why i am asking for an hint :) > and its also important that the VB-activeX dose not do callbacks on > the com-dll. all i want to do is to open an window of an activeX via a > interface function (where the name of the function and the activeX > name is stored in db). and therefore i want to completly separate the > calling process (c++ ocx) from the resultung activeX (vb-activeX). is > there some way to do this? > > "Alexander Nickolov" <agnickolov@mvps.org> wrote in message news:<ugzYoToFEHA.3132@TK2MSFTNGP12.phx.gbl>... > > Sounds like a recipe for disaster. I didn't quite follow your web, > > but the mere fact you are starting a worker thread is enough > > to convince me you don't know the rules. VB can only handle > > single-threaded components. And they should behave themselves > > too - they can only call back on the same STA thread. Furthermore, > > an ActiveX Control must be apartment-threaded too, thus all > > the communication with it happens on the same STA thread. > > It can internally spin worker threads of course, but they cannot > > call through direct interface pointers (and after marshaling the > > call winds up in the control's STA thread anyway). The control > > is responsible for terminating all threads it started before it > > unloads. Generally, using worker threads in STA objects is > > discouraged - it's tricky to do and not a matter for beginners. > > In your case you don't need it for sure, because a worker thread > > cannot participate in the shutdown process (it has to be terminated > > before the shutdown completes). > > > > -- > > ========================= > > ============ > > Alexander Nickolov > > Microsoft MVP [VC], MCSD > > email: agnickolov@mvps.org > > MVP VC FAQ: http://www.mvps.org/vcfaq > > ========================= > > ============
- Next message: Brian Muth: "Re: Accessing Singleton EXE COM Servers From Clients Running Under Different Accounts"
- Previous message: William Sonner: "Accessing Singleton EXE COM Servers From Clients Running Under Different Accounts"
- In reply to: udo polder: "Re: atl and threads"
- Next in thread: udo polder: "Re: atl and threads"
- Reply: udo polder: "Re: atl and threads"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|