Home › Forums › Software Development › [Solved] Project building with several errors when using EyeXFramework
Tagged: BadImageFormatException, eyexclient.dll, EyeXFramework, Tobii
- This topic has 29 replies, 7 voices, and was last updated 7 years, 1 month ago by Grant [Tobii].
- AuthorPosts
- 20/07/2016 at 05:53 #5427NAVEEN Kumar MANGALParticipant
Hello,
I’ve developed an Winform c# application which have lots of buttons.I’m trying to integrate it Tobii EyeX tracker in which buttons can be clicked by looking at them. I’ve followed the steps of developer guide for dotnet. I’ve added the eyex dotnet solution in my winform application but I’m unable to add Tobiieyex client dll in my winform application.
Please help.
Thanks.
20/07/2016 at 13:36 #5429Grant [Tobii]KeymasterHi @namanon14,
Could you kindly be more explicit in the errors you are facing? With more details, we will be better placed to assist you in getting started.
21/07/2016 at 04:34 #5435NAVEEN Kumar MANGALParticipantHello,
As mentioned above,I’ve developed winform application and integrating it with Tobii EyeX eye tracker.I’m using ActivatableButton forms provided in EyeX SDK. As per Tobii EyeX SDK guide I’ve added EyeXdotnet solution in my project by add>existing project.
But when I proceed to add Tobii.EyeX.client and Tobii.EyeX.client.ner20 dll files then it shows an error message “This file can’t be added.Make Sure that the file is accessible and valid component.”
Also when I plug my eye tracker in pc then it only glows but doesn’t work.
Please help, my final objective is to perform click operations in my winform c# application by looking at buttons by Tobii Eye Tracker.
Thanks in advance.
21/07/2016 at 11:30 #5436Alex [Tobii]ParticipantHi!
You only need to reference MANAGED dlls if you are programming in a managed language (for example C#):
– Tobii.EyeX.Client.Net20.dll
– EyeXFramework.dll
You also need to make sure that NATIVE dll ( Tobii.EyeX.Client.dll ) is copied to the output folder.Also make sure that you reference correct dlls depending on if you build for x86 or x64.
27/07/2016 at 07:59 #5453NAVEEN Kumar MANGALParticipantHello Alex,
I’ve referenced the managed dll as you told and settings are exactly same for client dll. I’ve also added activatablebuttons form in my project but still I’m unable to do click operation on buttons with gaze.Please help me.
Thanks
27/07/2016 at 11:29 #5454Alex [Tobii]ParticipantI f you are programming for WPF please make sure that you start your eyex host on app start:
public partial class App : Application { private WpfEyeXHost _eyeXHost; public WpfEyeXHost EyeXHost { get { return _eyeXHost; } } public App() { _eyeXHost = new WpfEyeXHost(); _eyeXHost.Start(); } protected override void OnExit(ExitEventArgs e) { base.OnExit(e); _eyeXHost.Dispose(); } }
I would suggest first trying to compile the sample from
source\WpfSamples\ActivatableElements\
and then transferring the code to your project line by line.
You can also check the device and tracking status after you initialize eyex to make sure that it works. Check this sample:
source\WpfSamples\UserPresenceWpf\Let me know if that helps.
/Alex
27/07/2016 at 11:38 #5455NAVEEN Kumar MANGALParticipantHi Alex,
I’m working on winform c# application development and perform select and trigger operation on buttons.I’m working on Visual Studion 2010.
Thanks
27/07/2016 at 13:03 #5456Alex [Tobii]ParticipantThen please check winforms samples:
source\FormsSamples\ActivatableButtonsForms\
source\FormsSamples\UserPresenceForms\27/07/2016 at 15:11 #5457NAVEEN Kumar MANGALParticipantHI Alex,
I tried with your suggestion, and copied ActivatableButtonsForms and UserPresenceForms in my project. However, it is generating exceptions at few places, as in here,
((IComponent)behaviorMap).Disposed += OnBehaviorMapDisposed;“Nullreference Exception is unhandled”
How do I proceed next? Kindly suggest.
27/07/2016 at 15:23 #5458Alex [Tobii]ParticipantHi!
I would suggest you compiling the samples first and making sure they work without transferring them to your project.
After that you can try to transfer them line by line to make sure that you don’t miss anything.I would also suggest you going for Visual Studio 2012 or newer if it’s possible since I can’t promise that the SDK works with 2010.
27/07/2016 at 15:45 #5459NAVEEN Kumar MANGALParticipantHi,
I am working with Visual Studio 2012. Now the problem arises at
_eyeXHost.Start();
Unable to load DLL ‘Tobii.EyeX.Client.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I am really clueless about this.
27/07/2016 at 16:05 #5460Alex [Tobii]ParticipantAs I said before please make sure that Tobii.EyeX.Client.dll is copied to your output folder (same folder where your exe file is). Make sure that it’s also a correct version – x64 for x64 applications and x86 for x86 applications.
Visual Studio doesn’t copy native dlls automatically so you need to copy it manually or automate this process with post build actions, including this dll as content file with “copy always” flag or a build script.
28/07/2016 at 06:02 #5461NAVEEN Kumar MANGALParticipantHi Alex,
Thanks for you help. Now my code is running.Can I do click operation on the button in my winform c# application with eye-gaze only (i.e. without any key press, only look at the button and at is clicked).
Thanks.
06/09/2017 at 18:03 #7360Adam DohertyParticipantI am trying to link tobii to a basic web browser i have created, and i am getting this error, which i cannot understand. [img]https://i.imgur.com/H9rpJgh.png[/img]
BadImageFormatException Error
07/09/2017 at 21:31 #7364Grant [Tobii]KeymasterHi @adamdoherty, this error message BadImageFormatException results when loading a dll by incompatible bitness (32 or 64-bit) on the solution/project vs. the DLL.
To resolve the error, you can either:
– Change target platform to x86 in your Visual Studio solution
– If you want to build a 64-bit application, change the references for the two DLLs Tobii.EyeX.Client.dll and Tobii.EyeX.Client.Net20.dll to the 64-bit versions, located in \lib\x64Also check that is within the project properties for visual studio is if “Prefer 32-Bit” has been enabled?
Please let us know how you get on.
- AuthorPosts
- You must be logged in to reply to this topic.