Code Snippets 

You will find links to an assortment of code snippets on this page which highlight use of a particular API or technology.

Most of these snippets have been extracted from production code and have, at most, been formatted to make them a bit more readable. It was thought that site visitors would find the code more useful if presented in this manner, rather than displaying idealized examples, which could be obtained via MSDN.


MS XML Parser Version 6.0

Connect to, and disconnect from, Microsoft's latest version of XML Parser.

Load an XML file from disk using the document 'load' method.

Save the current XML document to a file specified by the user.


GDI+

Draw text directly on screen using the Gdiplus::Graphics 'DrawString' method.

Create a triangle using the Gdiplus::GraphicsPath 'AddLine' method.

Display an image scaled to maintain its proportions.

Use the Gdiplus::Region 'IsVisible' method to detect a mouse click.