Home › Forums › Software Development › Exception in "public void Connect"
Tagged: behaviormap, error, Exception, issue
- This topic has 1 reply, 2 voices, and was last updated 8 years ago by
Patrik [Tobii].
- AuthorPosts
- 21/02/2015 at 20:44 #2581
Nicola
ParticipantHello Tobii,
provided that I am a novice with C# (I come from Java),
I’ve got the same problem for each C# project I try to start:An unhandled exception of type 'System.NullReferenceException' occurred in EyeXFramework.dll
at the line
((IComponent)behaviorMap).Disposed += OnBehaviorMapDisposed;
in the function
public void Connect(BehaviorMap behaviorMap)
occurring when called by
Program.EyeXHost.Connect(behaviorMap1);Do I have to initialize the variable behaviorMap1?
If yes, why it’s not initialized on the EyeXDotNet samples?
How do I have to initialize it?Thanks for your attention,
Neeque23/02/2015 at 10:19 #2585Patrik [Tobii]
ParticipantHello Nicola,
Are you calling
InitializeComponent();
before or after you’re connecting theBehaviorMap
to the host instance? Make sure you call it before.It should look something like this:
public MyForm() { // Initialize form components. InitializeComponent(); // Connect the behavior map to the host. Program.EyeXHost.Connect(behaviorMap1); }
Best regards
Patrik - AuthorPosts
- You must be logged in to reply to this topic.