Weird DLL problems: Windows Mobile 2003 Second Edition/eVC4 SP3

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Guy (guy691us_at_yahoo.com)
Date: 07/10/04


Date: 10 Jul 2004 10:50:30 -0700

Hi,

I have a small MFC app here that works fine on anything from PPC2000
to PPC2003, but when launched under PPC2003 (Windows Mobile 2003)
Second Edition, reports the following error:

"Cannot find 'MyApp' (or one of its components). Make sure the path
and filename are correct and all the required libraries are
available."

So, I analyzed the MyApp.exe dependencies using the Dependency Walker,
and the list is as follows:

System:

coredll.dll
mfcce300.dll
olece300.dll

Custom:

myappmodule1.dll
myappmodule2.dll

Also, I wrote a test program to LoadLibrary() each one of the
dependencies to see if I can get more information about HINSTANCE
value and GetLastError(). The results are as follows:

LoadLibrary on coredll.dll returns a valid HINSTANCE and 0.
LoadLibrary on mfcce300.dll returns a valid HINSTANCE and 0.
LoadLibrary on olece300.dll returns a valid HINSTANCE and 0.

LoadLibrary on myappmodule1.dll returns -2053706016 and 126 ("Module
not found").
LoadLibrary on myappmodule2.dll (dependent on myappmodule1.dll)
returns 0 and 1114 ("A dynamic link library (DLL) initialization
routine failed.")

Weird, I thought, so I performed the following three tests:

1.) Removed the myappmodule2.dll dependency on myappmodule1.dll.
LoadLibrary on myappmodule2.dll returns -2053706016 and 126 ("Module
not found").
2.) Added a test for a non-existing library, kaboom.dll. LoadLibrary
on kaboom.dll returns 0 and 126 ("Module not found").
3.) Added a test with a "minimum" 7Kb wizard-based embedded Visual
Studio 4.0 SP3 MFC DLL. LoadLibrary on wizmodule.dll returns
-2053706016 and 126 ("Module not found").

The above leads me to believe the following:

a.) Each one of the dependent libraries, myappmodule1.dll and
myappmodule2.dll - IS - on the PDA device, and the dynamic loader is
able to find them, physically.

b.) Each one of the dependent libraries encounter some kind of error
condition, since attempting to load a non-existing kaboom.dll library
returns 0 as the library HINSTANCE (per documentation) and the error
code of 126 ("Module not found"). Attempting to load one of the
"offending" libraries returns -2053706016 as the library HINSTANCE
(whatever that means), and 126 ("Module not found").

c.) The problem is not the standard failure of initialization. In such
case the returned library HINSTANCE was 0 (per documentation), with
the 1114 error code ("initialization routine failed").

d.) The problem is likely not related to DLL sub-dependencies. Even a
very basic MFC DLL created with eVC 4.0 SP3 shows the same problem.

Again, the same code works perfectly well on any other version of
Windows Mobile.

Anyone has any idea what the -2053706016 (0xFFFFFFFF8596EEE0 hex,
2241261280 unsigned) returned as HINSTANCE means??

Thanks,

G.



Relevant Pages

  • Re: HelloWin-Part2
    ... I don't seem to find "Additional libraries" I have Additional dependenties! ... >> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ... >> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM ...
    (microsoft.public.vc.language)
  • Re: VC++ 6.0 Project Settings question
    ... The other is an executable that is dependent on the static lib. ... In this dialog select your EXE project as the "project to modify" and check the box next to the LIB project in the "Dependent on" window. ... (That list is for "system" libraries that the compiler can consider to be static.) ... Now go to the "FileView" tree window and expand the tree so you can see the components of your EXE project. ...
    (microsoft.public.vc.language)
  • Re: Circular Dependency
    ... I have two libraries libA and libB, both of them are dependent on ... each other for certian symbols which is creating a circular dependency ...
    (comp.os.linux.development.apps)
  • Re: to learn jQuery if already using prototype
    ... major libraries like Prototype.js, jQuery, etc are all relatively ... Anyone who writes code that is dependent on aberrant behaviour ... The fundamental design of a library can be extremely modular ... industry standard with jQuery second industry standard compliant ...
    (comp.lang.javascript)
  • Re: HelloWin-Part2
    ... >>> I believe that I must make an addition to the object libraries. ... >>> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ... >>> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM ...
    (microsoft.public.vc.language)