title: Why is COM ignoring my DllSurrogate entry?
body: <p>I'm aware of <a href="https://stackoverflow.com/questions/1706429/how-exactly-do-i-config-dcom-to-load-my-dll-into-a-separate-process">this question</a>, but I've followed the steps listed there and I'm still stumped.</p>
  
  <p>I've got a class, registered as follows (this is an RGS file):</p>
  
  <pre><code>HKCR
  {
      NoRemove CLSID
      {
          ForceRemove {5CB1D770-BF72-4F3D-B4DA-85E0542126F4} = s 'ExamplePlugin Class'
          {
              val AppID = s '%APPID%'
              InprocServer32 = s '%MODULE%'
              {
                  val ThreadingModel = s 'Free'
              }
          }
      }
  }
  </code></pre>
  
  <p>I've got an AppID, registered as follows:</p>
  
  <pre><code>HKCR
  {
      NoRemove AppID
      {
          '%APPID%' = s 'ExamplePlugin'
          {
              val DllSurrogate = s ''
          }
          'ExamplePlugin.DLL'
          {
              val AppID = s '%APPID%'
          }
      }
  }
  </code></pre>
  
  <p>I'm passing <code>CLSCTX_ALL</code> to <code>CComPtr&lt;IPlugin&gt;::CoCreateInstance</code>.</p>
  
  <p>In short, as far as I can tell, I've followed <a href="http://msdn.microsoft.com/en-us/library/ms686606.aspx" rel="nofollow noreferrer">the checklist</a>:</p>
  
  <ol>
  <li>I have an AppID value specified under my CLSID. I have a corresponding AppID key.</li>
  <li>I've included <code>CLSCTX_LOCAL_SERVER</code> in the activation call. My CLSID key does not have any LocalServer keys.</li>
  <li>My CLSID key contains an InprocServer32 key.</li>
  <li>I assume that when the checklist says "the proxy/stub DLL specified in InprocServer32 exists", it means "the implementing DLL". It does exist. My proxy/stub DLL is correctly registered elsewhere.</li>
  <li>I have a DllSurrogate value under my AppID key.</li>
  </ol>
  
  <p>If I look at my class in OLE/COM object viewer, it appears to be correct (the Implementation tab has "Use Surrogate Process" checked).</p>
  
  <p>It's still not working: my DLL is loading into the same process as my host EXE.</p>
  
  <p>A clue: If I run Process Monitor, I can't see it looking for the <code>CLSID\{...}\AppID</code> value. If I pass <code>CLSCTX_LOCAL_SERVER</code> to CoCreateInstance, I get "class not registered" returned.</p>
  
  <p>I'm on Windows 2008 x64, but I've tried with my code compiled for both x86 and x64 with the same result.</p>
  
  <p>What am I missing?</p>