Exception when setting the form field.

Q: I create a form field (Text Field) using Adobe LiveCycle Designer
7.0". In the program, I set that form field to a value in my variable
buf as:


, it creates an exception: "Object reference not set to an instance of
an object.".


It is possible that the PDF form field doesn't have any value
associated with the field.

To go around this problem, use the following code when modifying the
form field:

// In C#
Field field = itr.Current();

// In C++
Field field = *itr;
field.SetValue(new Str(buf));