Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Mon, 22 Sep 2008 06:43:52 -0700,    group: microsoft.public.xml        back       


MSXML Handle Leaks   
I have a Windows service that exposes a COM object that accepts requests 
defined as XML documents - a sort of propretry SOAP I guess.

Anyway, the COM method signature looks like this:

HRESULT Server::Execute(BSTR in, BSTR* out)
{
    	/* ... */
}

The first thing I do is turn the string into an XML document.  I've tried 
using the document implementations in MSXML3, MSXML4 and MSXML6.

We recently added a request that's called with a high frequency and it 
highlighted that creating an XML document leaks a semaphore and an event 
handle (even if the object is properly released).

In all the other web posts I've found, I've seen other people with this 
problem but no one has found a general solution.

One idea is to do this:

HRESULT Server::Execute(BSTR in, BSTR* out)
{
   CoInitialize(NULL);

   /* ... */

   CoUninitialize();
}

And this works fine in my simple console test program.

But in a Windows service, I need to expose the COM object and I can only do 
this if the thread has already called CoInitialize(...).
date: Mon, 22 Sep 2008 06:43:52 -0700   author:   Chris Trueman ctruemanATwavesoftwareDOTcom

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us