<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[James's Programming Page — HidSharp RegisterClass failed]]></title>
	<link rel="self" href="https://swforum.seekye.com/feed/atom/topic/10118/" />
	<updated>2026-06-26T20:58:41Z</updated>
	<generator>PunBB</generator>
	<id>https://swforum.seekye.com/topic/10118/</id>
		<entry>
			<title type="html"><![CDATA[Re: HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13193/#p13193" />
			<content type="html"><![CDATA[<p>Are you actually needing to load two different versions of HIDSharp at the same time?</p><p>If not, the newest version has the method HidSharp.Utility.HidSharpLibrary.ManualShutdown() for cases where you need to manually shut down before program exit / AppDomain exit.</p><p>God bless.</p><p>James</p>]]></content>
			<author>
				<name><![CDATA[James]]></name>
				<uri>https://swforum.seekye.com/user/14092/</uri>
			</author>
			<updated>2026-06-26T20:58:41Z</updated>
			<id>https://swforum.seekye.com/post/13193/#p13193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13192/#p13192" />
			<content type="html"><![CDATA[<p>Can confirm that the Fix from mike works.<br />Error still happens in newest 2.6.4 Version</p><p>We had this Problem inside Unity Editor, when you re-enter PlayMode. Our System always opens hidsharp on Boot of the application and therefore this error happend every second time we try to test the game.</p><p>Error Message was:<br />InvalidOperationException: HidSharp RegisterClass failed.<br />&nbsp; at HidSharp.Platform.Windows.WinHidManager.Run (System.Action readyCallback) [0x00259] in &lt;67c7f6679e924554a9ce03957649737c&gt;:0 <br />&nbsp; at HidSharp.Platform.HidManager.RunImpl (System.Object readyEvent) [0x0000f] in &lt;67c7f6679e924554a9ce03957649737c&gt;:0 <br />&nbsp; at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00025] in &lt;34c8028f8a3946349d8f0d77e409a1ae&gt;:0 <br />&nbsp; at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in &lt;34c8028f8a3946349d8f0d77e409a1ae&gt;:0 <br />&nbsp; at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in &lt;34c8028f8a3946349d8f0d77e409a1ae&gt;:0 <br />&nbsp; at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in &lt;34c8028f8a3946349d8f0d77e409a1ae&gt;:0 <br />&nbsp; at System.Threading.ThreadHelper.ThreadStart (System.Object obj) [0x0000f] in &lt;34c8028f8a3946349d8f0d77e409a1ae&gt;:0 <br />UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)<br />UnityEngine.DebugLogHandler:LogException(Exception, Object)<br />UnityEngine.Logger:LogException(Exception, Object)<br />UnityEngine.Debug:LogException(Exception)<br />UnityEngine.&lt;&gt;c:&lt;RegisterUECatcher&gt;b__0_0(Object, UnhandledExceptionEventArgs)</p>]]></content>
			<author>
				<name><![CDATA[ego]]></name>
				<uri>https://swforum.seekye.com/user/17188/</uri>
			</author>
			<updated>2026-06-04T14:36:30Z</updated>
			<id>https://swforum.seekye.com/post/13192/#p13192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13068/#p13068" />
			<content type="html"><![CDATA[<p>Further work on this has led to me reluctantly having to patch the code, as there are scenarios where we need to load two versions for different purposes in the same app-domain.</p><p>A quick change to WinHidManager allows this:</p><p>&nbsp; &nbsp; &nbsp;protected override void Run(Action readyCallback)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string className = &quot;HidSharpDeviceMonitor&quot; + Guid.NewGuid().ToString(&quot;N&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NativeMethods.WindowProc windowProc = DeviceMonitorWindowProc;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var wc = new NativeMethods.WNDCLASS() { ClassName = className, WindowProc = windowProc };<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RunAssert(0 != NativeMethods.RegisterClass(ref wc), &quot;HidSharp RegisterClass failed.&quot;);</p><p>Mike</p>]]></content>
			<author>
				<name><![CDATA[mike.hudgell]]></name>
				<uri>https://swforum.seekye.com/user/14242/</uri>
			</author>
			<updated>2019-07-09T07:54:02Z</updated>
			<id>https://swforum.seekye.com/post/13068/#p13068</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13031/#p13031" />
			<content type="html"><![CDATA[<p>It was WIndows 10, but I know it was my error now, it appears we loaded two versions of the HIDSharp.dll by mistake and it looks like the second attempt to register the window failed and rippled to an app-domain failure.</p><p>We&#039;re now working on ensuring we don&#039;t load two versions which will sort the issue out.</p>]]></content>
			<author>
				<name><![CDATA[mike.hudgell]]></name>
				<uri>https://swforum.seekye.com/user/14242/</uri>
			</author>
			<updated>2019-02-08T09:34:29Z</updated>
			<id>https://swforum.seekye.com/post/13031/#p13031</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13030/#p13030" />
			<content type="html"><![CDATA[<p>Shouldn&#039;t be. What OS? Could you get line numbers with the debug version? Thanks!</p>]]></content>
			<author>
				<name><![CDATA[Zer]]></name>
				<uri>https://swforum.seekye.com/user/2/</uri>
			</author>
			<updated>2019-02-07T20:22:33Z</updated>
			<id>https://swforum.seekye.com/post/13030/#p13030</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[HidSharp RegisterClass failed]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/13029/#p13029" />
			<content type="html"><![CDATA[<p>I&#039;m seeing an error on one machine where it throws an InvalidOperation Exception </p><p>&nbsp; at HidSharp.Platform.Windows.WinHidManager.Run(Action readyCallback)<br />&nbsp; &nbsp;at HidSharp.Platform.HidManager.RunImpl(Object readyEvent)<br />&nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />&nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart(Object obj)&lt;/StackTrace&gt;&lt;ExceptionString&gt;System.InvalidOperationException: HidSharp RegisterClass failed.<br />&nbsp; &nbsp;at HidSharp.Platform.Windows.WinHidManager.Run(Action readyCallback)<br />&nbsp; &nbsp;at HidSharp.Platform.HidManager.RunImpl(Object readyEvent)<br />&nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)<br />&nbsp; &nbsp;at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />&nbsp; &nbsp;at System.Threading.ThreadHelper.ThreadStart(Object obj)</p><p>Is there any known issues around this?</p>]]></content>
			<author>
				<name><![CDATA[mike.hudgell]]></name>
				<uri>https://swforum.seekye.com/user/14242/</uri>
			</author>
			<updated>2019-02-07T11:17:49Z</updated>
			<id>https://swforum.seekye.com/post/13029/#p13029</id>
		</entry>
</feed>
