Just get rid of using CWinApp registry methods.
Instead you could use either raw Windows Registry Functions
or some classes like Microsoft CRegKey or ones "user developed" like
A Registry Class