views:

16

answers:

1

I have a VB6 COM+ component which is being accessed via IE6.

When running normally it works as expected, but when I am debugging in VS6 I get an error:

Method 'ownerDocument' of object 'IXMLDOMElement' failed

The code is as follows and it fails on the last line of this snippet:

Private m_ndContract As MSXML2.IXMLDOMNode
...
Dim ndElement As MSXML2.IXMLDOMNode
...
Set ndElement = m_ndContract.selectSingleNode("ELEMENT[ELEMENTID=" & strID & "]")
...
Call ndElement.appendChild(ndElement.ownerDocument.createElement("LIMIT"))

We are using msxml4 SP2 (I am aware that it is no longer supported and we should use SP3 but there are various infrastructure issues preventing that)

Any clues as to why this is happening during debugging only?

A: 

My memory is poor, but this was a breaking change in one of the MSMXML SP's

You can no longer append a node created on (or belonging to) another DomDocument.

http://msdn.microsoft.com/en-us/library/ms757047(VS.85).aspx

nonnb
Then why does it work under normal operation but not debugging?
Shevek