user1312155
user1312155

Reputation: 173

Debugging process load exception 0xc0000138 (Ordinal not found)

enter image description herewhile running my VC++ application on VS2010 i am getting following errors:-

'26aprilmadefromnewfoldercode.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\26aprilmadefromnewfoldercode\Debug\26aprilmadefromnewfoldercode.exe', Symbols loaded.
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\26aprilmadefromnewfoldercode\Debug\hdpw32.dll', Binary was not built with debug information.
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open the PDB file
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[5800] 26aprilmadefromnewfoldercode.exe: Native' has exited with code -1073741512 

(0xc0000138).

My exe file is built but it doesn't execute. How can I debug the process load or resolve this error?

Upvotes: 1

Views: 6725

Answers (3)

mloskot
mloskot

Reputation: 38940

I observed the very same 0xC0000138: Ordinal Not Found exception in a Windows process loading plug-in DLLs. The error was caused by two different versions of COMCTL32 loaded into the same process.

Try to use debugger (or Process Monitor) and check if by any chance you don't get two COMCTL32 modules loaded, like here:

...
'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll'. Symbols loaded.
...
'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll'. Symbols loaded.

If that's the case, then add explicit COMCTL32 reference to your application's manifest:

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" 
      name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
      processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

using one of the methods explained in MSDN: Enabling Visual Styles article.

Upvotes: 4

Benj
Benj

Reputation: 32418

You won't get a stack trace or a dump from this since it appears to have failed during dynamic library loading. The best think you can do with this is load it in depends.exe and look at the imported libraries and symbols, this should tell you which one can't be found.

Take a look at this question:

"The specified procedure could not be found" error when running app on Windows XP (exception c0000139)

It shows what can happen if you attempt to link against an API which is not available at dynamic link time and how to debug it using depends.exe.

Upvotes: 3

AlexTheo
AlexTheo

Reputation: 4184

It could be happen if you dll's exports the classes and was built with a different version of runtime library. So you have to check if all of your dlls was built with the same compiler with this which you use for your main application build. All you need to do is just clear the solution and build new lib, dlls which will replace the old version you have.

Upvotes: 1

Related Questions