Successive calls of SiTerminate() and SiInitialize()

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

Moderator: Moderators

Post Reply
f.schaaf
Posts: 14
Joined: Thu Jul 14, 2016 7:54 am

Successive calls of SiTerminate() and SiInitialize()

Post by f.schaaf » Tue Mar 20, 2018 6:33 am

We recently did a change to our application (which is a dll loaded by another app), so it can be loaded and unloaded during the runtime of the host process.
Our dll creates a hwnd which receives events from the spacemouse driver, however, after unloading and reloading our dll, it stops working.
We have fixed the problem by removing the call to

Code: Select all

SiTerminate()
but this is not according to the SDK documentation, where it states:
This function must be called to shut down the 3DxWare Input Library correctly. Once the 3DxWare Input Library is shut down, use SiInitialize before calling any input functions.

Code: Select all

	DriverData() : m_isReady(SiInitialize() != SPW_DLL_LOAD_ERROR), m_device(nullptr)
	{
		LOG(debug) << "[SM] SiInitialize() -> " << m_isReady;
	}

	~DriverData()
	{
		LOG(debug) << "[SM] ~DriverData()";
		//SiTerminate(); // this line causes the undesired behaviour.
	}
Is it safe to never call SiTerminate(), or do you have any idea on how we have to change the code to have it call SiInitialize() on load, and SiTerminate() on unload?

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

Re: Successive calls of SiTerminate() and SiInitialize()

Post by jwick » Sat Mar 24, 2018 3:15 am

What application do you load into?

Post Reply