Multiple windows?

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
gibson1
Posts: 14
Joined: Mon Jan 06, 2020 10:00 pm

Multiple windows?

Post by gibson1 » Tue Jan 07, 2020 10:25 pm

Hello,
I have a test application that uses a MFC multiple-document interface (MDI). Multiple windows can be opened at the same time, and each window can receive input from the SpaceMouse.

Question is, how should calls to SiInitialize(), SiClose(), and SiTerminate() be handled when dealing with multiple windows?

Is it safe to call SiInitialize() and SiTerminate() for every window that opens and closes, or should they only be called once at the top application level? Thanks.

jwick
Moderator
Moderator
Posts: 2665
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Multiple windows?

Post by jwick » Wed Jan 08, 2020 1:16 am

The API is designed to call SiOpen for each window that wants events (using its HWND) and SiClose when the window no longer wants the events (e.g., being destroyed).
It is expected that each window will get keyboard focus when it wants events. That is, normal MDI behavior.

Call SiInitialize / SiTerminate with the lifetime of the overall application.

gibson1
Posts: 14
Joined: Mon Jan 06, 2020 10:00 pm

Re: Multiple windows?

Post by gibson1 » Fri Jan 10, 2020 7:28 am

Ok, thank you.

Post Reply