<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Get Temp directory path</Title>
      <Shortcut>GetTempdirectorypath</Shortcut>
      <Description>Get Temp directory path [C++]</Description>
      <Author>Yan Michalevsky</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=50901970-f52f-4af6-a502-bb2eb33c9377</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="C++"><![CDATA[CString getTempDir()
{
	TCHAR tempPath[MAX_PATH + 1] = _T("");
	const UINT SIZE_IN_TCHARS = sizeof(tempPath)/sizeof(TCHAR); 
	
	DWORD retval = GetTempPath(SIZE_IN_TCHARS, tempPath);
	if (SIZE_IN_TCHARS < retval) {
		THROW(Exception(_T("Failed getting temp directory path")));
	}
	
	return CString(tempPath);
} //end of getTempDir]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>