title: dll loading error using LoadLibraryA
body: <p>We are trying to load a dll-library from inside a 64-bit dll using LoadLibraryA function. It returns 126 error - mod not found. The dll file path given to the function is correct, we are sure. </p>
  
  <p>We have tried a dummy dll to test and it worked, it is loaded. </p>
  
  <p>We also tried adding the dll (which is a dependcy of the first dll that we want to load) to the dummy dll. It also worked. So the problem seems not about the dependency dlls, but the original dll that we want to load in the first place. </p>
  
  <p>We also tried converting the dl to 64-bit, and tried that, still no good.</p>
  
  <p>We also checked the dependencies with Dependency Walker. Everything is OK.</p>
  
  <p>The operating system that we are using is Windows 8, 64bit. If it makes any difference.. 
  Does anyone have any idea about this poblem?</p>
  
  <p>EDIT:
  We also tried this code:</p>
  
  <pre><code>hModule = LoadLibraryW(L"C:\\temp\\dllToLoad.dll");
  </code></pre>
  
  <p>and received this error code:</p>
  
  <pre><code>"First-chance exception at 0x00000000 in C_Test_TSMPPKCS11.exe: 0xC0000005: Access violation at location 0x0000000000000000."
  </code></pre>
  
  <p>EDIT 2:
  The code that we used in the first place is:</p>
  
  <pre><code>hModule = LoadLibraryA((char*)aDLLFile);
  </code></pre>
  
  <p>EDIT 3:
  We are using complete path to load the dll. In order to test this we tried this code:</p>
  
  <pre><code>FILE *fp;
      int size = 0;
      fp=fopen("C:\\temp\\dllToLoad.dll", "r");
      size = fgetc(fp);
      printf("size:%d\n",size);
      fclose(fp);
  </code></pre>
  
  <p>There was no problem, we received the file size which is 77.</p>