Replace CComCriticalSection with CCriticalSection. Run as administrator when registering as startup application.
Do not quit after registers/unregisters as startup application.