Well, when finalization section is executed, the dll is being unloaded and
quite a few things would be better off elsewhere, COM is just one example.
As for the threads, since they are yours, you can devise means to signal the
threads to exit by setting a flag/Win32 event on the main thread and waiting
for the thread to terminate, while the thread could check for the flag/event
every once in a while. If you don't gracefully terminate the threads and
wait for their completion, they will be killed regardless, but they will not
have a chance to exit gracefully.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Aleksander Tischenko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Thats very moot point, althought destroying threads are not com-relared
> thing. And in any case application will not just kill its threads because
> they may allocate important resources, lock devices etc.
>
> Alex.
>
> "Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Do not do anything COM related in the initialization or finalization
> > sections in Delphi. OnQuit event or the destructor is a much better
place
> to
> > do the cleanup.
> >
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> >
> >
> > "Aleksander Tischenko" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Okay, just threads supposed to be destroyed in finalization section (I
> use
> > > Delphi), and this working in any other office application like Word or
> > > Excel. Additionaly I could not control Add-In unload event because my
> > > product is a third-party control for outlook Add-in.
> > >
> > > Anway, my customers fixed that by handing Outlook's OnQuit event.
> > > Thanks!
> > >
> > > Alex.
> > >
> > >
> > > "Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Outlook itsel wouldn't care less about any threads it does not
> conrol -
> > it
> > > > is your reposibility to shut down your threads or wait until they
> > > terminate
> > > > when Outlook unloads your add-in.
> > > >
> > > > Dmitry Streblechenko (MVP)
> > > > http://www.dimastr.com/
> > > > OutlookSpy - Outlook, CDO
> > > > and MAPI Developer Tool
> > > >
> > > >
> > > > "Aleksander Tischenko" <(E-Mail Removed)> wrote in
message
> > > > news:(E-Mail Removed)...
> > > > > Hi guys!
> > > > > My add-in to MS Outlook during its work create several threads.
This
> > > > add-in
> > > > > also working under Excel and Word, but only with Outlook I have
> > > problems.
> > > > >
> > > > > I noticed that when Outlook is being unloaded it just kills all
> > working
> > > > > threads. Because of that my threads does not terminated correctly
> and
> > I
> > > > got
> > > > > AV.
> > > > >
> > > > > Does anyone experiencied with that?
> > > > >
> > > > >
> > > > > Aleksandr.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>