Hello Everyone…
I’m new with Nuitrack and C#, however I developed an app in Winforms from where I use Nuitrack to collect data about the position of some joints.
To do this, inside the main Form I call a Form where the Nuitrack code runs. So far so good, I can get the data I want without problems.
The problem arises when I close the nuitrack form to complete the task I intend to complete. Because when I call the Nuitrack form again without closing the main Form, an error occurs and will not allow me to continue with the App.
The error is as follows:
Managed Debugging Assistant ‘CallbackOnCollectedDelegate’: ‘A callback was made to an unused delegate of type’ nuitrack.net! Nuitrack.NativeImporter + OnIssueTrackerUpdateCallback :: Invoke '. This can lead to application crashes, corrupted data, and lost data. When passing delegates to unmanaged code, the managed application must keep them active until they are sure they will never be called again. '
on
try
** {**
** Nuitrack.Update(_skeletonTracker);**
** }**
and if I pressed “Continue” appear the follow error:
System.NullReferenceException: 'The object reference was not defined as an instance of an object.'
also in
try
** {**
** Nuitrack.Update(_skeletonTracker);**
** }**
Anyone have any idea what might be happening?
I’ve already researched the probable reasons for this error. There is information for similar cases, but I could not figure out how to solve my particular case.
The code I use to start and quit Nuitrack runs through 2 buttons and is as follows:
// Button for begin training session
private void btnIniciarTreino_Click(object sender, EventArgs e)
{
//----------------------------------------------------------------------------------------------
NuitrackForm formNuitrack = new NuitrackForm(this);
formNuitrack.FormBorderStyle = FormBorderStyle.None;
formNuitrack.TopLevel = false;
formNuitrack.AutoScroll = true;
tableLayoutPanelNuitrack.Controls.Add(formNuitrack);
formNuitrack.Show();
//----------------------------------------------------------------------------------------------
}
// Button for end training session
private void btnTerminarTreino_Click(object sender, EventArgs e)
{
//Close the Form Nuitrack
// ------------------------------------------------------
NuitrackForm formNuitrack = new NuitrackForm(this);
formNuitrack.Close();
}
Thank you for all the help you can give me.
Best regards.