DeleteObject(handle_to_object) removes that resource associated with that handle from the system - this makes the associated handle invalid!
1. You should not delete a resource while it is selected into a Display Context.
2. you should leave a Display Context as you got it - (with the original brush, pen, bitmap and font)