C# application fails to call a method from C++ DLL/Project
<p>I try to integrate Web Camera support into C# solution. 1st of all I have learnt the nice example from Touchless.Vision. It contains C# solution with 3 components :
- one windows form project (C#, Any CPU)
- one wrapper project (C#, Any CPU)
- WebCamLib project (C++, x64)</p>

<p>I use Win7 x64.
So the example works fine. At least from the moment when I changes Platform target from Win32 to x64 for C   library/project.</p>

<p>But then I have added two projects (C# wrapper and C++ project) under another C# solution. Now it always fails when it calls a method from C++ project.</p>

<pre><code>System.BadImageFormatException was unhandled by user code
Message="Could not load file or assembly 'WebCamLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."
Source="Touchless.Vision"
FileName="WebCamLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
FusionLog=""
StackTrace:
   at Touchless.Vision.Camera.CameraService.&lt;BuildCameraList&gt;d__0.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Touchless.Vision.Camera.CameraService.get_AvailableCameras() in C:\CustomWare.NET\CustomWare\WebCamWrapper\Camera\CameraService.cs:line 40
</code></pre>

<p>The solution uses AnyCPU platform as well. I think there should not be any conflicts based on platform. </p>

<p>What can be the different between these two cases? What should I check?</p>
