Changing WinAPI calls to ATL and WTL calls