title: C# dll problem in windows 7
body: <p>I'm having exactly the same problem as the poster in this <a href="https://stackoverflow.com/questions/1741473/rapi-dll-problem-in-windows-7-c">question</a>. I have a visual studio C# projects from which I'm trying to call a function in another DLL (which is also part of the solution).</p>
  
  <p>The DLL is a C++ one and the exported function I'm trying to call is declared like this in C#:</p>
  
  <pre><code>[DllImport("SomeDLL.dll")]
  private extern static IntPtr SomeFunction(IntPtr someVar1, IntPtr someVar2, bool someVar3);
  </code></pre>
  
  <p>When I try to call the function from C# I see the following on the console output in the debugger:</p>
  
  <blockquote>
    <p>'MyApp.exe': Loaded
    'C:\SomePath\Build\Eddy\Debug\SomeDLL.dll'<br>
    'MyApp.exe': Unloaded
    'C:\SomePath\Build\Eddy\Debug\SomeDLL.dll'<br>
    'MyApp.exe': Loaded
    'C:\SomePath\Build\Eddy\Debug\SomeDLL.dll'<br>
    'MyApp.exe': Unloaded
    'C:\SomePath\Build\Eddy\Debug\SomeDLL.dll'<br></p>
  </blockquote>
  
  <p>And I the get the following error dialog:</p>
  
  <blockquote>
    <p>Unable to load DLL 'SomeDLL.dll': The
    specified module could not be found.
    (Exception from HRESULT: 0x8007007E)</p>
  </blockquote>
  
  <p>The code in question works fine on my colleagues windows XP machine. There's also another C++ DLL in the solution which works fine.</p>