Simple Parameter Substitution

I have added support for basic (I mean really basic) parameter substitution. This allows you
to parameterize your code templates which allows you to define more generic code templates. This
is done by using %1, %2, %3, ... to represent different parameters in your code template.
An example code template is provided below:

When this template is selected from the menu, all parameters are parsed and a dialog box
comes up with an edit control for each parameter. Simply fill in the parameters and voila
the parameters are bound to to the code template. For example if I typed OOGA for the parameter
%1 I would get the following bound template:

This allows you to highlight a class in the editor and generate code templates based upon that selection
without being prompted.

Source Code Column Alignment

Nothing bugs me more than code that is not formatted according to my style. I just hate the
way the MFC wizards insert code formatted so you cannot even read it (what a mess). I spend
half my time reformatting the code! I added column alignment support so that I can define
code templates so that they will align according to my or anybody's style. This of course is only
useful in conjunction with parameter substition as stated above. You use the %Cnnn symbol to specify
which column to align to, where nnn represents a column number. So given our class header example
above you can define the template more exactly by:

this allows you to test the syntax of your templates with your compiler in code first before attempting
to parameterize them.

Apply formatting.

Future Plans/Ideas:

To make these code templates more useful would be, instead of having them as a popup menu, have them more
integrated into the developer studio. For example perhaps as another tab in the workspace window.
You could have a tree control representing the code templates in another tab in the workspace window then
by double clicking/dragging dropping... you could easily add code or whatever to your project. You could
even drag a block of code from the editor to the code template window to define new templates!!!

I hope you find these minor modifications useful like I have. Don't hesitate to write me with bug fixes
improvements...

Comments

Excellent !!

I suppose this is what Michael Taylor was planning to do. It is wonderfull :) Congragulations... Except, as other two more "code template" add-ins this one also wasn't do anything except a button view at first. But I fix this by changing a line which for finding txt files place. Don't know why but all tree of code template add-ins couldn't work because of this problem. But I fixed all three of them by the same trick. So I'm using this (via VC++5 with any SP).
And not very important but what about usage of (######) seperators ?

Nice additions, but I'm having problems.

I seem to be having the same problem as I did with the original version. (Originally, MsDevDir was not a
defined environment variable for VC6.) Now, I guess that CODE_TEMPLATE_DIR is not defined. How do I define
it so that the add-in can find the template txt file?

Also, several of the build settings do not build. The one that I got to work was the Win32 Release
MinDependency.

Please let me know how to make it work.

(By the way, does this improvement include the work from all of the other versions -- 3 including the
original?)

Top White Papers and Webcasts

As virtualization becomes the norm throughout organizations of nearly all sizes, and as more organizations look to private cloud solutions, IT decision makers are increasingly in need of ways to keep storage costs and complexity under control in the face of often-runaway virtual machine (VM) sprawl. Application-aware storage is designed to help achieve these important goals. Read this white paper to learn how application-aware storage allows you to gain VM-level visibility into application performance and …

Live Event Date: April 21, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT
For mid-sized companies, the challenge of serving people and providing better service is forcing a re-evaluation of their contact centers to improve customer experiences. While these growing enterprises are driving much of the market's innovation, they must remain nimble in how they operate, and be very responsive to customer needs. This upcoming eSeminar reveals five ways mid-size organizations can gain needed agility and examines how delivering …