Click here to Skip to main content
12,955,614 members (60,244 online)
Click here to Skip to main content
Add your own
alternative version

Stats

42.2K views
505 downloads
12 bookmarked
Posted 31 Jan 2001

Devstudio Copyright Macro

, 31 Jan 2001
Rate this:
Please Sign up or sign in to vote.
A simple macro for adding a copyright notice to the start of your files.
<!-- Download Links -->
  • Download source files - 4 Kb
  • <!-- Main HTML starts here -->

    Introduction

    Visual Studio allows us to perform common,repetitive tasks through macros. You, as a developer, will often find the need to insert copyright notices to your source code.This is a simple macro that does just that at the click of a button. Make your code safe from copyright infringements and look professional, in seconds. Welcome to the wonderful world of macros to beginners. If you are already comfortable with macros, skip to the relevant parts.

    Copyright notices

    What are Copyright notices? Copyright notices are comments that are added to source code by the author, before public distribution of that source. These are typically present at the top of the source files. These comments make users of those source files aware about the copyright issues involved. Additionally you can insert any information that you find relevant.

    This, for example, is a copyright notice that I often use.

    ////////////////////////////////////////////////////////////////////////////
    // Copyright : Amit Dey 2000
    // 
    // Email :amitdey@mail.com 
    // 
    // This code may be used in compiled form in any way you desire. This
    // file may be redistributed unmodified by any means PROVIDING it is
    // not sold for profit without the authors written consent, and
    // providing that this notice and the authors name is included.
    //
    // This file is provided 'as is' with no expressed or implied warranty.
    // The author accepts no liability if it causes any damage to your computer.
    //
    // Expect Bugs.
    // Please let me know of any bugs/mods/improvements.
    // and I will try to fix/incorporate them into this file.
    // Enjoy!
    ////////////////////////////////////////////////////////////////////////////

    You will need to customise this notice to suit your needs.

    How to install and use.

    This macro is also distributed as a devstudio macro file (.dsm) and is customizable and easy to use. To install the macro follow these simple steps

    1. Download the attached .dsm file and copy it to your Devstudio Macros directory. (For me, this is located under MSDev98 directory)
    2. Open MSDEV and goto Tools->Customize and click on AddIns and Macro files Tab.
    3. Enable the Copyright macro by enabling the checkbox next to it.
    4. Click on the Commands tab and select Macros from the Category list box.
    5. Drag-n-drop Copyright macro to the Devstudio toolbar.
    6. Select appropriate text/image(or both) from the Button Appearence dialog box and click on Close

    Now you have the macro ready for use.

    To insert your own copyright notices,(as you have guessed) you'd need to modify few parts of the macro file. To do this, go to Tools->Macro and click on Copyright macro and hit Edit. Edit the macro file to alter the Copyright notices to suit your need. Save the file.

    That's it. (Phew!)

    To use the macro simply place the cursor in a file where you would like to insert the copyright notice and click on the copyright macro button and say Presto!

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    Share

    About the Author

    Amit Dey
    Web Developer
    India India
    Amit Dey is a freelance programmer from Bangalore,India. Chiefly programming VC++/MFC, ATL/COM and PocketPC and Palm platforms. Apart from programming and CP, he is a self-taught guitar and keyboard player.

    He can be contacted at visualcdev@hotmail.com


    You may also be interested in...

    Comments and Discussions

     
    GeneralNice... Pin
    Pablo Aliskevicius27-Apr-05 4:14
    memberPablo Aliskevicius27-Apr-05 4:14 
    QuestionCan this be used in VB Pin
    Anonymous3-Mar-01 14:08
    memberAnonymous3-Mar-01 14:08 

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

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

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web02 | 2.8.170525.1 | Last Updated 1 Feb 2001
    Article Copyright 2001 by Amit Dey
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid