Fix MSVC warnings
Create the context menu only if the current file requires C/C++.

REVIEW: 115152
Use unique_ptr instead of auto_ptr
Remove dead code