Did you ever feel the need for having all the macros defined in a file to get expanded automatically...
Now you may wonder why do we need such a thing, one reason could be to learn the intricacies of these macros.
For eg: BEGIN_MESSAGE_MAP, DECLARE_DYNAMIC, IMPLEMENT_DYNAMIC...
Now the question is how to do this... Here is nice little compiler option...
/P - PreProcess to File
/EP - Preprocess to stdout, no #line
/E - Preprocess to stdout
Now here is how we do this...
cl /P CMyDlg.cpp
This command will create a CMyDlg.i file which contains the entire source contents of CMyDlg.cpp along with all include files expanded with it's contents and all macros expanded to actual code.
But before all this just look at the size of CMyDlg.i. It could be in MB's. :)) But our source file's size was in KB's right? ;)
Well this shows the real thing that's going on.
I would like to give you a task, go through all the compiler options and find out what they do. Maybe take a printout of these options and hang it somewhere near to you, so that you can have a quick look at all compiler options, and understand what they do.
Hope this helps you and me to learn.