Home Forums Software Development Exception in "public void Connect"

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2581
    Nicola
    Participant

    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

    #2585
    Patrik [Tobii]
    Participant

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.