title: 64 bit ATL Control does not work with VC++ Forms app
body: <p>I have created an ATL control in a 64 bit unmanaged dll.</p>
  
  <p>I want to use this control in a VC++ WinForms app.</p>
  
  <p>When I run the application I get badimageformatexception.</p>
  
  <p>Then I have created an VB app and a C# app. In both cases it works with no problem.
  I have then tested my control with TstCon (MFC-64bit) provided by microsoft. The control was recognized with no problems and I was able to call some of its methods.</p>
  
  <p>The only case where I was NOT able to make it work is VC++ Forms (I work with VS 2010 pro).</p>
  
  <p>I have created a small test example.</p>
  
  <p>Please download it from here:</p>
  
  <p><a href="https://rapidshare.com/files/2799321813/atl.zip" rel="nofollow">https://rapidshare.com/files/2799321813/atl.zip</a></p>
  
  <p>The ATL Control is located in atl_project_64 folder.
  It is a simple control with 1 property (Number) and one event (OnChange). 
  I have followed all steps from here : <a href="http://msdn.microsoft.com/en-us/library/599w5e7x.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/599w5e7x.aspx</a></p>
  
  <p>Compile the project.</p>
  
  <p>Then, I have created 2 WinForms apps for testing the control. The C# is working with no problems.
  Dont forget to add the reference to Atl_project_64Lib. If you cannot find it in the list of Com objects, you may browse it to the folder where the dll is created.</p>
  
  <p>However, VC++ project is not working. You will get badimageformatexception if you try to run it. Sometimes the error is raised when I press the button which sets the value of the property.</p>
  
  <p>All are 64 bit.</p>
  
  <p>Do you have any idea what I have done wrong ?</p>
  
  <p>thanks,
  mihai</p>