Your app is trying to load a DLL either explicitly by calling LoadLibrary or implicitly by linking with the associated static linked library and it fails with error code 193, "The specified module could not be found" or a message that indicates that the app isn't a Windows CE application.
The possible causes of this are:
- The dll isn't a built for Windows CE
This happens when taking a dll from Big Windows (NT, XP, Vista) and trying to use it on a Windows CE device. - The dll isn't built for the processor family
This happens when taking a DLL that was built for a different processor than the target processor - Another dll that the dll needs to load isn't available
This happens when the DLL that you are loading then loads another DLL and there is a failure when that DLL tries to load another DLL that fails. - If a function that is needed isn't in the dll.
This happens if the dll on the system isn't the same as the the one that was being built when the lib that you linked to was created. It is sometimes a symptom of using the wrong SDK for your target.
There are other tools that you can use, but I usually use Dumpbin to view information about the Application or DLL. Dumpbin /DEPENDENTS file.dll will tell you which DLLs the file needs to implicitly load.
Example Dumpbin /DEPENDENTS:
>dumpbin /DEPENDENTS explorer.exe
Microsoft (R) COFF/PE Dumper Version 7.10.4017
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file explorer.exe
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
ole32.dll
OLEAUT32.dll
commctrl.dll
ceshell.dll
shcore.dll
IECEEXT.dll
COREDLL.dll
Summary
1000 .CRT
1000 .data
2000 .pdata
1F000 .rsrc
25000 .text
Which tells us that Explorer.exe needs to successfully load ole32.dll, OLEAUT32.dll, commctrl.dll, ceshell.dll, shcore.dll, IECEEXT.dll and COREDLL.dll. But that isn't the whole story, we would need to do the same for each of those dlls to determine if they also have dependents.
You can also use dumpbin to determine which functions are used from the dlls. Dumpbin /IMPORTS file.dll will show the DLL and the functions:
Example Dumpbin /IMPORTS explorer.exe (although I left some out for brevity)
>dumpbin /IMPORTS explorer.exe
Microsoft (R) COFF/PE Dumper Version 7.10.4017
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file explorer.exe
File Type: EXECUTABLE IMAGE
Section contains the following imports:
ole32.dll
36524 Import Address Table
35D48 Import Name Table
0 time date stamp
0 Index of first forwarder reference
17 CoGetInterfaceAndReleaseStream
29 CoMarshalInterThreadInterfaceInStream
8 CoCreateInstance
22 CoInitializeEx
44 CoUninitialize
commctrl.dll
364E0 Import Address Table
35D04 Import Name Table
0 time date stamp
0 Index of first forwarder reference
Ordinal 42
Ordinal 36
Ordinal 41
Ordinal 18
The functions used by ole32.dll are fairly clear, but the functions used from commctrl.dll are listed based on their ordinals. That isn't particluarly useful, but we can find the function names using dumpbin /EXPORTS commctrl.dll.
Example Dumpbin /EXPORTS commctrl.dll (again I left some out for brevity)
>dumpbin /EXPORTS c
Microsoft (R) COFF/PE Dumper Version 7.10.4017
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file commctrl.dll
File Type: DLL
Section contains the following exports for commctrl.dll
00000000 characteristics
480FA68C time date stamp Wed Apr 23 17:13:48 2008
0.00 version
1 ordinal base
77 number of functions
70 number of names
ordinal hint RVA name
35 0 0001E298 CenterWindow
36 3 0001E8CC CommandBands_Create
41 5 0001EFD0 CommandBands_GetRestoreInformation
42 12 0001F3E4 CommandBar_InsertMenubarEx
18 42 0003BD1C PropertySheetW
So now we can see that the ordinals match up to functions with names.
Copyright © 2008 – Bruce Eitman
All Rights Reserved
Your Comments.
If you copy your DLL or EXE inside the %FLATRELEASEDIR% of your CE OsDesignand open it inside dependency walker it will report all the DLLs needed by your executable and all its dependencies and the functions liked by each module (useful to understand if you need to add some component that add their APIs to coredll).
Bruce