title: How do I add a 64-bit Visio Drawing control in VS 2012?
body: <p>We are using an embedded Visio drawing control in our application as an automated visualization tool to represent system heirarchies.  Code-behind uses Visio interop to create and lay out all of the shapes. The "designer" portion, with the embedded Visio document, is accomplished through a custom control that utilized the (ActiveX) Visio Drawing control within a WindowsFormsHost control.</p>
  
  <p>This approach has worked well for several years, up to now.  We first implemented in VS2008/Visio 2007, then migrated to VS2010, and then Visio 2010.  Once we had moved to VS2010/O2010, we added another build targeted for x64.</p>
  
  <p>To do this, I had to rebuild the ActiveX control. Since VS designer doesn't support the 64-bit version of the Visio Drawing control, you can't just simply create a WindowsFormsHost and drop the Visio Drawing control onto it; the WPF control has to be built differently from the way the 32-bit version is. I can't remember <em>exactly</em> how I did it, but I think it was basically this (possibly based on <a href="http://www.techyv.com/questions/findind-drawing-control-microsoft-visio-2010-64-bit-version" rel="nofollow">this</a>):</p>
  
  <ol>
  <li>Create a WPF form in a build environment with 32-bit Visio installed</li>
  <li>Drag/drop the Visio Drawing control from the toolbox to the form, inside a WindowsFormsHost. Performing this step causes VS to create (and add a reference to) a new DLL, "Microsoft Visio 15.0 Drawing Control Type Library" of type AxMicrosoft.Office.Interop.VisOcx. This DLL is put into the /obj/Release directory under the project.</li>
  <li>Build the project to create the WPF control DLL for the final x86 solution build</li>
  <li>For your 32-bit solution, copy &amp; reference both <em>{your control}</em>.dll <em>and</em> AxMicrosoft.Office.Interop.VisOcx.dll.</li>
  <li>Save, copy/move &amp; open this control project in a build environment with 64-bit Visio installed</li>
  <li>Change the build target to x64</li>
  <li>Build the project to create the WPF control DLL for the final x64 solution build</li>
  <li>Copy &amp; reference /bin/Release/<em>{custom control}</em>.dll and /obj/Release/AxMicrosoft.Office.Interop.VisOcx.dll.</li>
  </ol>
  
  <p>I can build for the 32-bit version, but this doesn't work with Visio 2013 64-bit.  Any clue how to get this done?</p>