A new instance of my control (ActiveX) is created when OnChanged F

A

Asi BS

Hi,

I managed to create a new ActiveX control in C# for Infopath.
It’s a simple control (True/False) designed for proof of concept.
It seems to be working fine; the data is updating and so are other controls
that are bind to the same field.

Even though I am pretty happy with the result, I have noticed that every
time the
SetValue property is activated a new control is created right after the
OnChanged event is fired, and the old one destroyed. (In that order)

Is it a normal behavior of Infopath or is something wrong with my control?

This problem can cause other, more complex controls to malfunction,
When trying to accrue resources which didn’t released (yet) by the original
control.

Thanks in advance
Asi.
 
B

Brian Teutsch [MSFT]

This is the normal behavior of InfoPath. InfoPath does not make any promises
about the lifecycle of the control, and it's pretty much guaranteed that it
will be destroyed and recreated multiple times, possibly at times when data
unrelated to your control changes.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top