Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Using ProfUIS as Static Lib Collapse All
Subject Author Date
Sachin Gupta Aug 25, 2006 - 3:00 PM

Hi, The size of my simple MFC application is 60KB. If I use ProfUIS as a dll <<ProfUIS254m.dll>>, the executable size remains at 60KB.

I want to statically link with ProfUIS lib <<ProfUIS254ym.lib>> [size=13.5MB]. For this I added the flag __STATPROFUIS_WITH_DLLMFC__ to the Preprocessor Definitions field in the C/C++ and Resources categories. With this the size of my application increased to almost 1.5MB [from the earlier 60KB]. This is a huge difference.

We are only using the CExtMenuControlBar and CExtToolControlBar classes of Prof-UIS, and not using any other feature.

I have also checked that the #defines __EXT_MFC_NO_GRIDBASEWND, __EXT_MFC_NO_GRIDWND, __EXT_MFC_NO_CUSTOMIZE are already commented in our licensed product.

Is there a way to further reduce the size of the lib <<ProfUIS254ym.lib>> so that the application size also reduces??

Please help.

Thanks,
Sachin

Technical Support Aug 26, 2006 - 7:16 AM

The most valuable thing in Prof-UIS 2.54 which affects the generated EXE/DLL size when using Prof-UIS statically is the collection of bitmaps in resources related to the Office 2007 themes (the total size is 1,703,482 bytes). If you do not want to use Office 2007 themes, just comment the BITMAP resource lines in the ..\Prof-UIS\Include\Resources\Res2007\Res2007.rc file. But in our opinion the EXE size is not really critical because it is not a large module which is loaded long but rather it is a module which contains many resources.

Sachin Gupta Aug 26, 2006 - 8:20 AM

Yes you are right that EXE size should not matter. But in our applicaion we also have some OLE components and we want to reduce theor size also. I will try this option of removing Office2007 bitmaps and see if that helps.

Is there any other thing which needs to be done to reduce size of dll/exe?

Technical Support Aug 27, 2006 - 9:36 AM

Another approach to decreasing the size is to exclude some code parts from the Prof-UIS library by uncommenting the //#define __EXT_MFC_NO_*** lines in the Prof-UIS.h file (see this FAQ for more details).

Suhai Gyorgy Aug 29, 2006 - 6:29 AM

Dear Support!

Please, revise your above mentioned FAQ. Last sentence in it is:
"For instance, if you do not need the grid control and your application is not customizable, just comment the lines below:"

It should be:
"..., just uncomment the lines below:"

Thank you.

Best regards:
Chris

Technical Support Aug 29, 2006 - 8:02 AM

Thank you for reporting the issue. We updated the FAQ both on the site and in the documentation.

Sachin Gupta Aug 28, 2006 - 7:49 AM

Hi,

As mentioned in my first post, all the __EXT_MFC_NO_* defines are already commented in the licensed version. My initial question was is there anything other than this also?

We really want to decrease the size of exe / dll when using Prof-UIS as a static lib.

Please help.

Thanks,
Sachin

Suhai Gyorgy Aug 29, 2006 - 1:48 AM

In your first post you only mention 3 of the many defines that can be commented or uncommented. These 3 defines were only examples in that FAQ mentioned above in this thread. Try reading that FAQ again more carefully. In your case you need to uncomment all the defines that correspond to parts of the Prof-UIS library you don’t need.

For example: Your Prof-UIS.h needs to be changed like this ( that’s only an example, you need to do the same with many other lines in that file):

You have now:
//#define __EXT_MFC_NO_GRIDBASEWND

You should have :
#define __EXT_MFC_NO_GRIDBASEWND

So it is now commented, but you need to uncomment it (and many other lines). As its name suggests, if you have this line uncommented (so that your compiler will compile that line as well), you will have NO GridBaseWnd. If you leave the line commented (so that the compiler ignores the line), that means the corresponding Classes (in this case GridBaseWnd) will be compiled into your application as well.

I hope my english is good enough to explain the situation clearly.

Technical Support Aug 28, 2006 - 10:55 AM

The MSO.DLL file in Office 2007 beta has a size of aproximatelly 20 MB. So Prof-UIS actually has some space to grow.