Click to See Complete Forum and Search --> : STA problem with Windows NT, Windows XP


tomakali
August 3rd, 2005, 06:11 AM
I have created a multi-threaded application which works without any
problems on a NT-4.0 Workstation/Server. When I try to run the same
application in Windows XP, I get an error in a call to
CoMarshalInterThreadInterfaceInStream which returns -2147418113.

NOTE: this is out-process com server(STA)

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)
{
IEvent* pEvent = (IEvent*)*pp;
IStream* pIStream;
HRESULT hr = CoMarshalInterThreadInterfaceInStream(IID_IEvent,
pEvent, &pIStream);
if(SUCCEEDED(hr))
{
CComPtr<IEvent> pMarshalEvent;
hr =
CoGetInterfaceAndReleaseStream(pIStream, IID_IEvent,
(void**)&pMarshalEvent);

if(SUCCEEDED(hr))
hr =
pMarshalEvent->NewCurrentCassette(m_pCurrentCassette, m_setBy);
}
P++;
}
Environment - Windows-XP,SP-2,Visual Studio 6.0,SP-4,ATL-3.0
Should I be doing anything different in Windows XP?
Regards
Bhuvana