Sunday, January 30, 2011

How to Write a Macro in VS 2010

 

We all knows that how much friendly the macros are. Here I am showing a small example of how to write macro to Disable and Enable macros.

 

When debugging projects.Its difficult to add and remove break points all the time. This is a simple macro which enable and disable the Breakpoints

First thing is how to write a macro

Step1: Select Tools –> Options –> Macros –> Macro Explorer (Alt+F8)

image

Step2: Double click on the module created.(Here it is Module2)

image

Step3: Write your Macro Code

image

Step4 : Build the Macro code

 

How to add the Macro created to VS10

Step 5: go to vs10 Project(Take a new one not in Macro) Tools –> Options

 

image

Step 6: Under Environment Variables –> Keyboard –> in Show Commands containing –> Select the macro you created.

image

 

Step 7: Type the key combination then click Assign and then Ok

 

image

Finally: Go to VS and Press the key combination (in the example I shown only for Enable, for disable also do the same step)

 

Hope this will help you.

Monday, January 10, 2011

Import and Export Break Points in VS 2010

 

VS2010 has so many features. One of the best thing is import and export the break point.

Steps to Follow

Step 1: Put the break point

1

 

Step 2: Click on Export all Break Points

2

Step 3:  Select the location and save the XML

3

Step 4: Remove all break points and Click on Import Breakpoints from a file

4

Step 5: Select the saved XML File.

5

 

All the breakpoints will reappear Smile

 
Counter