I
intell1
Hi:
the following situation arises in my application (mfc 4.2, WinXP): the main
thread needs to call AfxOleInit() to enable drag&drop and other functions; a
worker thread also needs to call AfxOleInit() to enable Word automation,
which is its main function. (NOTE: the worker thread cannot launch MS-Word
unless an explicit call to AfxOleInit() is made).
The problem: upon exiting the application, the COleObjectFactory object
compains about two OLE references (m_dwRef = 2), since only one (or none) is
expected. The assertion is actually placed in the CCmdTarget (its parent
class) destructor.
When the worker thread is not executed, there is no problem. Also, under
Win2K, there is no problem even when the worker thread is executed.
Any information on this issue will be valuable.
TIA,
Nikolas
the following situation arises in my application (mfc 4.2, WinXP): the main
thread needs to call AfxOleInit() to enable drag&drop and other functions; a
worker thread also needs to call AfxOleInit() to enable Word automation,
which is its main function. (NOTE: the worker thread cannot launch MS-Word
unless an explicit call to AfxOleInit() is made).
The problem: upon exiting the application, the COleObjectFactory object
compains about two OLE references (m_dwRef = 2), since only one (or none) is
expected. The assertion is actually placed in the CCmdTarget (its parent
class) destructor.
When the worker thread is not executed, there is no problem. Also, under
Win2K, there is no problem even when the worker thread is executed.
Any information on this issue will be valuable.
TIA,
Nikolas