Switch between header and impl files in VS.NET

For some odd reason VS.NET doesn’t have the built-in capability to switch between .h and .cpp files from the keyboard. Almost every other programming editor I’ve used has this ability. A lot of people think that it’s just not possible in VS.NET

Well, it is, but it requires some programming and configuration. Fortunately, the program has been written many times by other programmers, so all you need to do is some cut and pasting. Here are the steps:

1) In VS.NET go to Tools -> Macros -> Macros IDE

2) Create a new Macro module under “MyMacros”, call it “Switch”

3) Visit The Code Project and copy the code for the “Switch” module into your new macro you just created.

4) Save changes, close the Macros IDE

5) Verify it works by going to Tools -> Macros -> Macros explorer, finding your new macro, right-clicking it, and selecting “Run”

6) Assign a shortcut to your new macro by going to Tools -> Options -> Environment -> Keyboard and typing “Switch” into the search box.

OK! Now you can get some REAL work done!

Leave a Reply