Solved

Automatically update comctl32.dll

Posted on 1998-03-12
5
295 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:ayelle
  • 3
  • 2
5 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 260 total points
ID: 1411926
Use the Win32API function GetFileVersionInfo on the comctl32.dll and compare the version you get back with the minimum version that you know contains the required function.
0
 

Author Comment

by:ayelle
ID: 1411927
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!
0
 
LVL 32

Expert Comment

by:jhance
ID: 1411928
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.
0
 

Author Comment

by:ayelle
ID: 1411929
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 ?

0
 
LVL 32

Expert Comment

by:jhance
ID: 1411930
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C#: need to import an entire CSV file 4 60
Is AWS.RDS considered a part of "Big Data"? 4 128
Best book to learn C++ 4 87
What namespace do I need to import? 2 48
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question