The Direct3D API covers quite a bit of ground, particularly if you include D3DX. A question that arises fairly often in discussion forums is “where can I find an example of xxx?” for some particular API function or method named xxx.
Fortunately, Visual Studio contains a tool that allows you to find code examples quickly. From the Edit menu, select “Find and Replace” and then select “Find in Files”. This brings up the following dialog:

In the dialog I’ve selected the location of my C++ samples from the DirectX SDK as the location to search and I’ve selected the type of file to match all C++ source files. Once I start the search, I will get matching hits in the Find Results window. You can step through each hit by double-clicking it in the Find Results window. This will cause Visual Studio to load the source file into the editor so that you can see the API call in the context of the sample.






