Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large EXE size with MFC

Status
Not open for further replies.

tkjames

Technical User
Apr 23, 2001
10
US
We have developed an MDI application . It has a few screens (around 10 windows) and use MS flex list control. The problem is that the EXE size is huge . Around 24 MB. Any ideas on how to reduce the EXE size
 
Forgive me if I'm insulting your intelligence with these suggestions. I have no way of knowing the level of your expertise.

If you're not already doing so, choose "Use MFC in a Shared DLL" rather than "Use MFC in a Static Library" in your project settings for the main project and any dependent libraries.

However, you may need to include the dependent DLL's in your distribution to ensure that every client PC has at least the version of the DLL's that you require.

Also, as long as the code is well tested and stable, distribute only the Release rather than the Debug versions.
 
programsecrets,

Thanks to the reply. But we already do this.

We noticed that when we changed the fontsize and color for highlighting (both used in in the MS flex grid control), the EXE size increased from 7 MB to 24 MB
 
Ah, I think what's happening is that you're using the "designer" to create your grid. When you do that, it saves LOTS of data to describe the grid, including perhaps the color of each cell, etc.

What I do is programmatically create the grid and make API calls to set the colors, fonts, etc. This removes the need to save data describing the grid in the resource file when it's compiled.

Unfortunately, this may take a lot of work on your part to change at this point, but I hope my explanation at least helps you to understand why it's happening. ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top