Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CoMarshalInterThreadInterfaceInStream and WinXP

Status
Not open for further replies.

getbabs

Programmer
Joined
Jan 30, 2002
Messages
3
Location
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top