Infopath async callback DOM

N

Nick

Does anyone know how to use callback functions in infopath managed code to
and use the application and XDocument object model? When ever I try, it says
something like cannot be called when the object is in this state.
 
S

Scott L. Heim [MSFT]

Hi Nick,

Can you provide some additional information on what you are doing and what
is failing? For instance, the following code works for me on the click
event of a button using VS.NET:

Dim xNode
xNode =
thisXDocument.DOM.selectSingleNode("//my:myFields/my:field1")
MsgBox(xNode.text)

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
N

Nick

Yes, it has to do with the delagates and async callback operation. Im
speculating, because I dont fully understand the "under - the - hood" stuff
for the async callback, but if its on a different thread, then something is
preventing access to the XDocument DOM.
 
N

Nick

Here is the exact error:

{"Operation is not valid due to the current state of the object." }

I tried to use this from the global variable as well as passing it in the
delegate / async worker function. Both yield the same result.
 
Top