How to create a property sheet in C++ Win32 ???

I'd want to banish the MFCs dlls from my project, so I decided to write a real Win32 application (with MSVC++6.0 SP3).
Do you know how to code a full win32 propertysheet (with 4 tabbed dialogs) embedded in my dialog-box, without using any MFCs?
Best Regards.
Who is Participating?
fwilkinsonConnect With a Mentor Commented:
Go back in to Project / Settings.  Note the "Settings For" field on the left.  Make sure you have highlighted your current project (all of it) in the tree control, and have selected "Win32 Relese" or "All Configurations" above that.  Then select "Using MFC in a Static Library" on the General tab.  Then go to the Link tab, and check the libraries listed in "Object/library modules".  Get rid of anything in that field that you don't need.  Press OK.

After you rebuild your EXE, you can check to see if the MFC import library was linked to it with Windows Quick View.  Right click on your EXE file, and select "Quick View".  Scroll down to the Import Table section, and you will see each DLL that is imported at load time, and all the functions that get linked in.

1st, Make Your 4 dialogs as they are separate dialog, with their class, they will be the PropertyPage-s.

Then make a new Class in classwizard with CPropertySheet subclass.

In this class constructor you can add these 4 pages with AddPage(); (PropertySheet::AddPage()), you have to make it 4 times. And there will be functions OnActive, OnAply, OnCancel and so on, where you can process everithing. If you don't know something you have to see CPropertyPage and CPropertySheet class members, and it is recommended to use classwizard to add your actions in your class


CPropertySheet & CPropertyPage are MFC classes.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

tradinfoAuthor Commented:
So, is it really impossible to create a PropertySheet with 4 tabbed dialogs embedded in a dialogbox, in real Win32, WITHOUT these enourmous MFCs dlls???

No one here created such a Win32 app?

I really hope someone has the solution...

Best regards.
If is can be done in MFC, it CAN be done without MFC.  This is true since MFC is written in Win32 API.

The problem is that it's a real pain in the butt to do it outside of MFC.  It's not that it's impossible, it's just a lot of work.  The Windows Common Control DLL contains a PropertyPage & PropertySheet control which is available for you to use.  Why don't you break out your Win32 SDK and read up on it?
tradinfoAuthor Commented:
Well, if I wanna use only Win32 programming, and only this way, it's because i don't want to distribute these HUGE dlls files (MFC42=940kb, comctl32.dll=430kb...). I don't want to distribute such enormous files, as I only use 5% of their contents !!!
It's difficult for me to accept this state of fact. Why creating an install file of 2Mb as it should be possible to create the same in full Win32 75% smaller (and maybe faster) ???
My way of thinking should sounds old fashion to some of you, but i come from an era (not so far) where each byte were important and speed too, and i don't understand that under the pretext of the disk space is now not anymore a problem, and microprocessors handle Gigaflops, programmers doesn't want anymore to create the most efficient program, but the easiest-to-code for them !!!
I'm sure many of you understand what I mean.

I have to reduce the size and increase the speed of my VC++6.0 code, so I re-ask my question:

Do you know how to code a full win32 propertysheet (with 4 tabbed dialogs) embedded in a dialog-box, without using any MFCs?
I hope one of you will have the answer.

Best Regards.

P.S: This answer was not directed against people who answered my question ! I just wanted to explain as clearly as possible what was my goal :-)
If you use MFC with statically linked DLL-s, MFC adds about 50-60K to your file, so you don't be afraid of megabytes. I think you are using DEBUG version when you build your project. Try to switch into RELEASE option. It helps, because my program length in generally 1-2MB in debug and 100-200K in Release.
tradinfoAuthor Commented:
I am in release option and you still have to distribute along with your program the MFC42 DLL-s...even if you use statically linked options.
I try to minimize all third-party dlls to distribute with my project, and and to obtain a monolithic program, running without external dependencies...

You can statically link the parts of MFC you need, but simply setting release mode isn't the way to do it.  You must tell the linker to link with static MFC libraries.  In Visual C++ 6, go to the Project/Settings menu (or Alt+F7), select the "General" tab, and change the "Microsoft Foundation Classes" setting to "Use MFC in a Static LIbrary".

Alternatively, you can find the Win32 documentation for property sheets in the MSDN Library, under Platform SDK / User Interface Services / Shell and Common Controls / Common Controls / Property Sheets.

tradinfoAuthor Commented:
well, there is a problem.
I am in release mode, and told the compiler to statically link mfc libraries with my project.
Ok, my executable becomes bigger. And it seems my project doesn't need anymore mfcs dlls...
When i check the dlls used by my project (with Norton Utilities foe example, we can see all modules in memory and libraries they use), i got a really bad surprise:
Even with these options, My project still uses MFC42.DLL and MFC42LOC.DLL !!!
It's a shame, my project is bigger than ever because i statically linked the mfcs to it, and still needs these f* mfc42 dlls ! I don't understand this compiler!

(I use the latest version of MSVC++ 6.0, SP3)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.