We have created a multi-threaded application which works without any problems on a NT-4.0 Workstation.
When I try to run the same application in Windows XP, I get an error in a call to CoMarshalInterThreadInterfaceInStream which returns
-2147418113.
This problem can be duplicated with different machines running Windows XP.
I have provided a snippet of the code below where the call fails in Windows XP
//--------------------------------------------------------------------------------------------------
HRESULT hr = S_OK;
IUnknown** pp = p->m_vec.begin();
while (pp < p->m_vec.end() && hr == S_OK)
{
if (*pp != NULL)
{
ICCMEvent* pICMEvent = (ICCMEvent*)*pp;
IStream* pIStream;
HRESULT hr = CoMarshalInterThreadInterfaceInStream(IID_ICCMEvent,
pICMEvent , &pIStream);
CComPtr<ICCMEvent> pMarshalEvent;
hr = CoGetInterfaceAndReleaseStream(pIStream, IID_ICCMEvent,
(void**)&pMarshalEvent);
ATLTRACE("CCM::NewCurrentCassette before call to sink function\n");
hr = pMarshalEvent->NewCurrentCassette(m_pCurrentCassette, m_setBy);
ATLTRACE("CCM::NewCurrentCassette after call to sink function, hr=%lx\n",
hr);
}
pp++;
}
//--------------------------------------------------------------------------------------------------
Environment - Windows-XP,SP-2,Visual Studio 6.0,SP-4,ATL-3.0
Should I be doing anything different in Windows XP?
When I try to run the same application in Windows XP, I get an error in a call to CoMarshalInterThreadInterfaceInStream which returns
-2147418113.
This problem can be duplicated with different machines running Windows XP.
I have provided a snippet of the code below where the call fails in Windows XP
//--------------------------------------------------------------------------------------------------
HRESULT hr = S_OK;
IUnknown** pp = p->m_vec.begin();
while (pp < p->m_vec.end() && hr == S_OK)
{
if (*pp != NULL)
{
ICCMEvent* pICMEvent = (ICCMEvent*)*pp;
IStream* pIStream;
HRESULT hr = CoMarshalInterThreadInterfaceInStream(IID_ICCMEvent,
pICMEvent , &pIStream);
CComPtr<ICCMEvent> pMarshalEvent;
hr = CoGetInterfaceAndReleaseStream(pIStream, IID_ICCMEvent,
(void**)&pMarshalEvent);
ATLTRACE("CCM::NewCurrentCassette before call to sink function\n");
hr = pMarshalEvent->NewCurrentCassette(m_pCurrentCassette, m_setBy);
ATLTRACE("CCM::NewCurrentCassette after call to sink function, hr=%lx\n",
hr);
}
pp++;
}
//--------------------------------------------------------------------------------------------------
Environment - Windows-XP,SP-2,Visual Studio 6.0,SP-4,ATL-3.0
Should I be doing anything different in Windows XP?