updated the main function to use CMessageLoop and ATL initialization functions