What is a safe way to lock a thread in a single-threaded application?
Is this a safe way to locking a thread?


Yes, it's the recommended way: see for example std::lock_guard

However:


I don't see why the destructor is virtual
You should probably disable/prevent the copy constructor and assignment operator
The constructor should probably take a reference (which can't be null) not a pointer
Try to ensure (though you're probably doing this already) that the destructor will not throw an exception



  Will the thread become unlocked if an exception occurred within Foo() and the catch block catches the exception?


It will unlock when CProcessCritSec is destroys, which happens as soon as it goes out of scope, which happens whenever you leave the try statement (before you enter any catch statement).