<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Events Not Working in C#? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Events-Not-Working-in-C/m-p/1006809#M32437</link>
    <description>&lt;P&gt;Hello there,&lt;/P&gt;

&lt;P&gt;Recently got the chance to (finally) try out the camera, and while nice so far, I've been having trouble with getting events to work. &amp;nbsp;My code can be found over on my Github (https://github.com/gemisis/Pinch-Me), and when trying an event based approach, I modify the mainForm_Load method in mainForm.cs to look like this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;        private void mainForm_Load(object sender, EventArgs e)
        {
            session = PXCMSession.CreateInstance();
            manager = session.CreateSenseManager();

            if (manager == null)
            {
                Console.WriteLine("Failed");
            }
            manager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 1920, 1080, 30);
            manager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH, 640, 480, 60);
            manager.EnableHand();

            PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler();
            handler.onNewSample = this.newColorFrame;
            manager.Init(handler);

            manager.StreamFrames(true);
        }&lt;/PRE&gt;

&lt;P&gt;According to the SDK Documentation, that should work, but I receive the following error&amp;nbsp;:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;An unhandled exception of type 'System.Runtime.InteropServices.SafeArrayTypeMismatchException' occurred in libpxcclr.cs.dll&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;Any ideas what could be causing this?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2014 02:27:26 GMT</pubDate>
    <dc:creator>Gerald_M_1</dc:creator>
    <dc:date>2014-12-01T02:27:26Z</dc:date>
    <item>
      <title>Events Not Working in C#?</title>
      <link>https://community.intel.com/t5/Software-Archive/Events-Not-Working-in-C/m-p/1006809#M32437</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;

&lt;P&gt;Recently got the chance to (finally) try out the camera, and while nice so far, I've been having trouble with getting events to work. &amp;nbsp;My code can be found over on my Github (https://github.com/gemisis/Pinch-Me), and when trying an event based approach, I modify the mainForm_Load method in mainForm.cs to look like this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;        private void mainForm_Load(object sender, EventArgs e)
        {
            session = PXCMSession.CreateInstance();
            manager = session.CreateSenseManager();

            if (manager == null)
            {
                Console.WriteLine("Failed");
            }
            manager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 1920, 1080, 30);
            manager.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH, 640, 480, 60);
            manager.EnableHand();

            PXCMSenseManager.Handler handler = new PXCMSenseManager.Handler();
            handler.onNewSample = this.newColorFrame;
            manager.Init(handler);

            manager.StreamFrames(true);
        }&lt;/PRE&gt;

&lt;P&gt;According to the SDK Documentation, that should work, but I receive the following error&amp;nbsp;:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;An unhandled exception of type 'System.Runtime.InteropServices.SafeArrayTypeMismatchException' occurred in libpxcclr.cs.dll&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;Any ideas what could be causing this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 02:27:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Events-Not-Working-in-C/m-p/1006809#M32437</guid>
      <dc:creator>Gerald_M_1</dc:creator>
      <dc:date>2014-12-01T02:27:26Z</dc:date>
    </item>
    <item>
      <title>You need implement</title>
      <link>https://community.intel.com/t5/Software-Archive/Events-Not-Working-in-C/m-p/1006810#M32438</link>
      <description>&lt;P&gt;You need implement&amp;nbsp;onNewSample. You can find details @https://software.intel.com/sites/landingpage/realsense/camera-sdk/2014gold/documentation/html/index.html?manuals_color_and_depth_picture_alignment.html&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 22:13:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Events-Not-Working-in-C/m-p/1006810#M32438</guid>
      <dc:creator>Xusheng_L_Intel</dc:creator>
      <dc:date>2014-12-01T22:13:58Z</dc:date>
    </item>
  </channel>
</rss>

