Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1999-06-24
10
Medium Priority
?
1,223 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:tradinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 2

Expert Comment

by:baeg
ID: 1401228
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

0
 
LVL 32

Expert Comment

by:jhance
ID: 1401229
baeg,

CPropertySheet & CPropertyPage are MFC classes.
0
 

Author Comment

by:tradinfo
ID: 1401230
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.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 32

Expert Comment

by:jhance
ID: 1401231
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?
0
 

Author Comment

by:tradinfo
ID: 1401232
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 :-)
0
 
LVL 2

Expert Comment

by:baeg
ID: 1401233
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.
0
 

Author Comment

by:tradinfo
ID: 1401234
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...

0
 
LVL 1

Expert Comment

by:fwilkinson
ID: 1401235
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.


0
 

Author Comment

by:tradinfo
ID: 1401236
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...
but...
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)

0
 
LVL 1

Accepted Solution

by:
fwilkinson earned 400 total points
ID: 1401237
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.


0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question