Click here to Skip to main content
Click here to Skip to main content

Adding an icon file's icons to an executable

, 24 Jul 2008 CPOL
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.

Introduction

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.

Background

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!

License

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

Share

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.

Comments and Discussions

 
GeneralThanks Pinmembersplendided6-Nov-08 23:39 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.141029.1 | Last Updated 24 Jul 2008
Article Copyright 2008 by Simon Parmenter
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid