Solved

Automatically update comctl32.dll

Posted on 1998-03-12
5
274 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now