Home Forums Software Development Problem: System.DllNotFoundException Reply To: Problem: System.DllNotFoundException

#2033
Robert [Tobii]
Participant

Hi Sia,

I looked briefly in your sample code. It looks like one problem is the using statements:

            using (var eyeXHost = new EyeXHost())
            {
                eyeXHost.Start();

                using (var stream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered))
                {
                 // ...

This means that the EyeXHost and data stream instances will be disposed right afterwards. You need to save a reference to the EyeXHost and stream object, and only dispose them when you dispose your TobiiController instance.

See MSDN for best practices regarding the using statement and IDisposable:
http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx
http://msdn.microsoft.com/en-us/library/yh598w02.aspx