Click here to Skip to main content
13,350,861 members (53,772 online)
Click here to Skip to main content
Add your own
alternative version


12 bookmarked
Posted 24 Jul 2008

Adding an icon file's icons to an executable

, 24 Jul 2008
Rate this:
Please Sign up or sign in to vote.
A VS2008 C++ project to add an icon resource in a file to an executable.


This VS2008 C++ project uses the STL and the Boost 1.35.0 library to produce a simple command line utility that takes the arguments of an icon file name, an executable file name, and optionally an integer in the range [1, 64K]. It then adds the icons in the icon file and adds them to the executable.


This project came about as I had to add an icon resource to a product of a build which utilises the Qt qmake build system. As far as I could determine, this system does not allow for the required flexibility in assigning icon resources and versioning resources for a WinXP build. I initially solved my problem using batch files to parse rc files as a pre-link activity but after a post resource compilation. I decided that it was not very elegant and resolved to create a utility, to be used post-link, in my own time.

Information to achieve this simple goal is not very plentiful and what does exist is not concise.

Points of Interest

The C++ code uses STL file streams for getting the data out of the file and the boost::shared_array smart pointer for memory management.

Doxygen is used to provide the HTML documentation. Look for 'index.html' in the HTML bucket. It gives a nice way to explore the code.

I hope that this helps somebody!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Simon Parmenter
United Kingdom United Kingdom
My profession is Software Engineering.

I am qualified as an electrician and at one time was CORGI registered for domestic gas installations.

I have been a member of the British Computer Society (present grade CITP) and the ACCU since 1997.

You may also be interested in...


Comments and Discussions

GeneralThanks Pin
splendided7-Nov-08 0:39
membersplendided7-Nov-08 0:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 24 Jul 2008
Article Copyright 2008 by Simon Parmenter
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid