You should get used to check the many great FAQs here at CodeGuru. If you had done that you would have found this:

MFC General: How to process command line arguments in a MFC application?

Laitinen