Link to home
Start Free TrialLog in
Avatar of ayelle
ayelle

asked on

Automatically update comctl32.dll

We change an application (using BC5 with Win32 API) to use the new feature included with the new comctl32.dll (Ver 4.72). When a system that as not been upgraded with the new version of comctl32.dll start the application the following message appears:

The App.exe file is linked to missing export comctl32.dll:initcommoncontrolsEx.

How can we detect an invalid comctl32.dll before the application start an display that error message.

The goal is to start a second application that will updtate the comctl32.dll automatically from the first one.
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ayelle
ayelle

ASKER

The problem is that as soon as the application start, it display the error messages concerning the missing export comctl32.dll:initcommoncontrolsEx (The application don't even start). I know that i can look for the version of the DLL with some API fonction. But my problem is that the application don't even start!
What language/programming environment are you using?  You need to check the DLL version BEFORE creating any windows.  By creating a window that uses any of the common controls, you will get the comdtl32.dll loaded by default.
Avatar of ayelle

ASKER

I'm using WIN32 API with borland C++ 5.02. I'm placing a MessageBox right in my WinMain procedure (before creating any windows by calling the CreateWindow fonction) and the error pop out before the MessageBox.

Is it normal ?

The right way to solve this is to have your installer check for the required versions of this DLL and install the correct one if needed.  

Another possibility, if you can't go the installer route, would be to write a small loader program that has no COMCTL32 objects in it which runs and checks your DLL version.  If it's too old, it loads the right one, if it's OK, it loads the main application and exits.