开发者

Changing the Visual Studio Default Class Setup

开发者 https://www.devze.com 2023-04-10 19:41 出处:网络
I want to change the default code generated by visual studios \'add->class...\' for C and C++. Currently it looks like

I want to change the default code generated by visual studios 'add->class...' for C and C++.

Currently it looks like

#pragma once
class GlWindow
{
public:
    GlWindow(void);
    ~GlWindow(void);
};

Whereas I would like to开发者_JAVA百科 use proper include guards, no premade constructor/destructor, and have the curly brace up next to the class name.

I've been annoyed by this ever since I've adapted my own coding style. I've been using my own script for it thus far, but having it add my class files to the project while visual studio is open would be a huge time saver.

Thanks a lot friends. Hopefully this is possible.


You can find the code behind generating a generic C++ class in INSTALLED_FOLDER\VC\VCWizards\CodeWiz\Generic\Class\Scripts\1033\default.js.Where INSTALLED_FOLDER represents "C:\Program Files (x86)\Microsoft Visual Studio 10.0\" You can write a custom template or wizard to generate code which meets your own standards. Hope this link will take you to the details to create a custom VS template.

0

精彩评论

暂无评论...
验证码 换一张
取 消