What the...?

Something bad happened

We're not sure what, but we have a few guesses.

Problem: Object reference not set to an instance of an object.
Ticket: 7864823
Server: Web01
Visual Studio 2005/2008 Addin to Open Src Files (*.h/*.cpp) Consistently on the Left/Right - CodeProject Click here to Skip to main content
11,715,022 members (65,079 online)
Click here to Skip to main content

Visual Studio 2005/2008 Addin to Open Src Files (*.h/*.cpp) Consistently on the Left/Right

, 13 May 2010 CPOL 68.4K 596 35
Rate this:
Please Sign up or sign in to vote.
Visual Studio 2005 Addin to open *.h files on the left and *.c/*.cpp files on the right
codewinpos.jpg - Click to enlarge image
When CodeWinPos is enabled, all .h files are opened on the left with the same position and size. Likewise for .c/.cpp files on the right.

Introduction

CodeWinPos is a simple plugin (VSIP) for Visual Studio 2005/2008 which opens *.h files on the left half of the IDE workspace and *.c/*.cpp files on the right. It works with either the tabbed or MDI window layout options in Visual Studio 2005/2008 IDE.

Background

Updated: March 2009 for Visual Studio 2008.

The project was completed in ~ March 2007 and I have been using it daily since then without encountering any bugs.

The download contains both the source and a setup.exe as well as a CodeWinPosSetup.msi. The setup.exe and CodeWinPosSetup.msi install the same binary VSIP addin.

CodeWinPos may be removed by invoking the uninstall routine via the Control Panel Add/Remove programs.

This plugin is an aid in an effort to use the mouse as little as possible. I use this along with another plugin which with a single CTRL-key stroke switches between *.h and *.cpp files.

Using the Code

Back in Visual Studio 6, it only took a couple dozen lines of macro to accomplish this. Now in Visual Studio 2005/2008 and the VSIP, it takes all of the code in this addin to accomplish it.

History

Original Project Specs

The product is a Microsoft Visual Studio 2005/2008 Integration Package (using Visual Studio SDK) which will allow the user (a developer) to have automatic control over the position of code windows when opened.

Problem

Standard Visual Studio opens code windows in either:

  1. The currently selected tab group if "Tabbed documents" is selected, or
  2. Cascading style if "Multiple documents" is selected

Using the tabbed style at least the Windows are sized consistently, but there's no consistency as far as *.Hs on the left and *.Cs on the right. With the MDI/cascading option, you're left with having to size and position code windows with the mouse every time you open them. I find it entirely cumbersome to have to reach for the mouse when I shouldn't have to.

Desired behavior with product installed: If "Tabbed documents" is selected, then *.h files will open in the left tab group and *.cpp files will open in the right tab group. If "Multiple documents" is selected, then *.h files will open in the left half of the MDI workspace and *.cpp files will be opened in the right half of the MDI workspace.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

mikem8
Software Developer (Senior) Pecan Ventures, LLC
United States United States
Software engineer.

You may also be interested in...

Comments and Discussions

 
QuestionFeature Request (if still active) Pin
samaursa23-Nov-11 5:10
membersamaursa23-Nov-11 5:10 
AnswerRe: Feature Request (if still active) Pin
mikem823-Nov-11 6:02
membermikem823-Nov-11 6:02 
GeneralMy vote of 5 Pin
samaursa30-Sep-10 18:52
membersamaursa30-Sep-10 18:52 
GeneralAwesome Pin
samaursa26-Aug-10 8:15
membersamaursa26-Aug-10 8:15 
GeneralPackage Load Failure Pin
Geoffrey Armstrong17-May-10 21:40
memberGeoffrey Armstrong17-May-10 21:40 
GeneralRe: Package Load Failure Pin
mikem818-May-10 4:02
membermikem818-May-10 4:02 
GeneralRe: Package Load Failure Pin
Geoffrey Armstrong18-May-10 18:41
memberGeoffrey Armstrong18-May-10 18:41 
GeneralRe: Package Load Failure Pin
mikem818-May-10 18:46
membermikem818-May-10 18:46 
GeneralRe: Package Load Failure Pin
samaursa26-Aug-10 8:12
membersamaursa26-Aug-10 8:12 
QuestionAny handy way to make a keyboard shortcut open a .h for the current .c file? Pin
supercat912-May-10 5:57
membersupercat912-May-10 5:57 
AnswerRe: Any handy way to make a keyboard shortcut open a .h for the current .c file? Pin
mikem812-May-10 6:12
membermikem812-May-10 6:12 
QuestionToo small Pin
DavidCrow11-May-10 4:41
mvpDavidCrow11-May-10 4:41 
AnswerRe: Too small Pin
mikem811-May-10 8:30
membermikem811-May-10 8:30 
GeneralRe: Too small Pin
Paul Selormey11-May-10 17:36
memberPaul Selormey11-May-10 17:36 
GeneralRe: Too small Pin
mikem814-May-10 13:58
membermikem814-May-10 13:58 
Questionfile downloaded is 0 byte Pin
Kin Hoon24-Nov-08 23:54
memberKin Hoon24-Nov-08 23:54 
AnswerRe: file downloaded is 0 byte Pin
mikem825-Nov-08 3:20
membermikem825-Nov-08 3:20 
GeneralGood idea! Pin
rm226-Feb-08 22:15
memberrm226-Feb-08 22:15 
GeneralRe: Good idea! Pin
mikem827-Feb-08 5:36
membermikem827-Feb-08 5:36 
QuestionInstall doesn't work? Pin
Roms19-Feb-08 6:39
memberRoms19-Feb-08 6:39 
AnswerRe: Install doesn't work? Pin
mikem819-Feb-08 9:37
membermikem819-Feb-08 9:37 
GeneralRe: Install doesn't work? Pin
Roms19-Feb-08 11:00
memberRoms19-Feb-08 11:00 
GeneralRe: Install doesn't work? Pin
mikem819-Feb-08 11:14
membermikem819-Feb-08 11:14 
AnswerRe: Install doesn't work? Pin
Valentin Ivanov19-Feb-08 12:08
memberValentin Ivanov19-Feb-08 12:08 
QuestionHow is this better than splitting the window? Pin
Shawn Poulson13-Aug-07 20:41
memberShawn Poulson13-Aug-07 20:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150901.1 | Last Updated 13 May 2010
Article Copyright 2007 by mikem8
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid