title: Methods of sharing class instances between processes
body: <p>I have written a C++ class that I need to share an instance of between at least two windows processes. What are the various ways to do this?</p>
  
  <p>Initially I looked into <a href="http://msdn.microsoft.com/en-us/library/h90dkhs0(VS.80).aspx" rel="nofollow noreferrer">#pragma data_seg</a> only to be disappointed when I realised that it will not work on classes or with anything that allocates on the heap.</p>
  
  <p>The instance of the class must be accessible via a dll because existing, complete applications already use this dll.</p>