I am creating a windows application using 3rd party dll. They had given some predefined methods to use. There is a method SetTag()
which is use to update a value. Now my work is to get data from tcp client and send to this method. My tcp part is working well, I had tested it. The problem is occurring at the time when I call SetTag()
. It works well for a while but after some time, it's showing just-in-time debugger pop-up with exception
An unhandled exception has occurred in myproject.vshost.exe
I don't understand from where this exception is occurring.
Whenever I get data from tcp client, my UpdateValues()
is called, which calls the third-party SetTag()
// valuesInArray is an object array which contain
// the data from tcp client after converted to object
UpdateValues(valuesInArray);
and the method:
public void UpdateValues(object[] values)
{
this.BeginUpdate();
for (int i = 0; i < 9; i++)
{
this.SetTag(TagHandle[i], (values[i]), Quality.Good, FileTime.UtcNow);
}
this.EndUpdate(false);
}
I had created a simulator, where the data is not coming from tcp client, itis sending data in a timer tick event. In that case no error is occurring and the program runs smoothly. Can you suggest why this error is occurring using tcp client and how I get rid of it?