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)


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


Step3: Write your Macro Code


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



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



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



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



Step 2: Click on Export all Break Points


Step 3:  Select the location and save the XML


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


Step 5: Select the saved XML File.



All the breakpoints will reappear Smile