Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Switch between Header and CPP File for Visual Studio .NET

, , 3 Jun 2008
Here are two methods that allow you to quickly switch between associated header and implementation files in Visual Studio .NET
hcppswap.zip
h_cpp_switcher.zip
��

Option Strict Off

Option Explicit Off



Imports EnvDTE

Imports Microsoft.VisualBasic





Public Module Switch



    Sub Switch()

        '////////////////////////////////////////////

        'Nooruddin Kapasi 1998.

        'Pavel Sokolov , CEZEO software , http://www.cezeo.com , Adaptation for .NET

        'DESCRIPTION: Switch Between Header and cpp

        '////////////////////////////////////////////

        Dim a As String

        Dim b As String

        Dim Flag As Integer

        Flag = 0

        a = DTE.ActiveDocument.FullName()

        tmp = InStr(a, ".cpp")

        If tmp Then

            b = Left(a, Len(a) - 3) + "h"

            Flag = 1

        Else

            tmp = InStr(a, ".h")

            If tmp Then

                b = Left(a, Len(a) - 1) + "cpp"

                Flag = 1

            End If

        End If



        If Flag Then

            DTE.Documents.Open(b, "Text")

        End If

    End Sub





End Module

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Authors

Pavel Sokolov
Web Developer
Russian Federation Russian Federation
C++ programmer.

Pierre Arnaud
Web Developer
Switzerland Switzerland

Pierre Arnaud got a Ph.D. in computer science at the Swiss Federal Institute of Technology; he currently works both as an independent contractor on hardware and software projects at OPaC bright ideas and as a senior software designer at EPSITEC.

Pierre was a key contributor to the Smaky computer, a real time, multitasking system based on the Motorola 680x0 processor family.

Now, Pierre works on his spare time for the Creative Docs .NET project: it is a vector based drawing and page layout software based on .NET and AGG.


| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 3 Jun 2008
Article Copyright 2002 by Pavel Sokolov, Pierre Arnaud
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid