Marshaling And Unmarshaling of IXMLNODEList
-
I am developing multi-threaded system and I m using xml in it. What I m doing is passing MSXML2::IXMLDOMNodeList Node to each worker thread. While passing this node I m doing marshalling of the node and then sending the stream pointer to the thread. When I unmarshal the pointer it doesn’t unmarshal it properly It gives “error while reading the disk” Here is the code Marshalling LPSTREAM pStreamQueryItem; pVoid=pStreamQueryItem=0; xmlQueryItems->QueryInterface (IID_IXMLDOMNodeList,(void**)&pVoid); CoMarshalInterThreadInterfaceInStream(IID_IXMLDOMNodeList,(MSXML2::IXMLDOMNodeList*)pVoid,&pStreamQueryItem); pThreadInfo->m_xmlQueryItems = pStreamQueryItem; pThreadInfo->m_hThreadHandle = _beginthreadex(NULL,0,CWebCrawler::ExecuteComplexCrawler,(void*)pThreadInfo,CREATE_SUSPENDED,&(pThreadInfo->m_dwThreadID)); Unmarshalling LPVOID pvQueryItems=0; // pThreadInfo->m_xmlQueryItems it’s the stream object CoGetInterfaceAndReleaseStream(pThreadInfo->m_xmlQueryItems,IID_IXMLDOMNodeList,(LPVOID*)&pvQueryItems); xmlQueryItems.Attach((MSXML2::IXMLDOMNodeList*)pvQueryItems); can you please let me know why it is going wrong. Do you have any alternatetive idea for above matter Thanks in advance Nitin Patil http://www.igentica.com