<?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>2019-07-09T07:54:02Z</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/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>
