- This topic has 1 reply, 2 voices, and was last updated 9 years, 7 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Software Development › Exception in "public void Connect"
Tagged: behaviormap, error, Exception, issue
Hello 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,
Neeque
Hello Nicola,
Are you calling InitializeComponent();
before or after you’re connecting the BehaviorMap
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