title: Shared Resources in SlimDX with DX10
body: <p>I'm trying out the shared resources feature of DX10, as I needed this for one of my project. But I'm can't find much sample or code especially using SlimDX. According to DX10 documentation, I just need to specified the resources as Shared, then I can open it using OpenSharedResource() from another application. With a simple test application in SlimDX, I did the following</p>
  
  <pre><code>        Texture2D tex = new Texture2D(device, new Texture2DDescription()
          {
              ArraySize = 1,
              BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource,
              CpuAccessFlags = CpuAccessFlags.None,
              Format = Format.B8G8R8A8_UNorm,
              Height = 128,
              Width = 128,
              MipLevels = 1,
              OptionFlags = ResourceOptionFlags.Shared,
              SampleDescription = new SampleDescription(1, 0),
              Usage = ResourceUsage.Default,
          });
  
          Texture2D tex2 = device.OpenSharedResource&lt;Texture2D&gt;(tex.ComPointer);
  </code></pre>
  
  <p>But I keep getting this error</p>
  
  <pre><code> E_INVALIDARG: An invalid parameter was passed to the returning function (-2147024809)
  </code></pre>
  
  <p>I can't seems to figure out what went wrong, as the tex.ComPointer might not be the right pointer for OpenSharedResource or Texture2D is not supported (it's not clearly mentioned that it isn't in the documentation)</p>
  
  <p>The other alternative by specifying pHandle to be passed into the CreateTexture function is not available in SlimDX or I'm not aware of it.</p>
  
  <p>Has anyone who has tried this successfully? Some help would be grateful.</p>
  
  <p>Thanks</p>