Skip to main content

Posts

Showing posts from May, 2020

Code Snippets for Visual Studio

Visual Studio has a great feature to speed entry of frequently typed lines of code called Code Snippets. It works by typing a few chars and pressing tab (C++) or tab-tab (C#). For C# my favorites are 'cw' for adding 'Console.WriteLine' and 'mbox' for adding 'MessageBox.Show'. Visual C++ lacks a similar snippet for adding AfxMessageBox--until now. To add this as a new snippet, save the XML below as a file with extension *.snippet and open the Visual Studio Snippet manager. (Searching "Code Snippets Manager" from the search box is an easy way to find it.)  Then import the snippet under Visual C++/My Code Snippets. Enjoy the increased productivity! <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0">   <Header>     <Title>AfxMessageBox</Title>     <Author>nzmCode...