To expand on my comment about use of the transponder:
If already in receipt of an ATC service, pilots are taught to retain the transponder code already given by ATC, where one has been given (a code isn't always given; not all ATC units have secondary radar) rather than to change to 7700 unprompted, if an emergency subsequently occurs (while still in receipt of that service). As part of the termination of that service, the pilot will reselect his VFR code, i.e. 7000.
If an emergency occurs prior to r/t contact being made with ATC, pilots are taught to squawk 7700 unless subsequently told to set something else by ATC. They may be directed to retain 7700 in this situation.