O'Reilly logo

Windows® CE 3.0 Application Programming by Marshall Brain, Nick Grattan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and Deleting Directories

Typically a user creates a directory with the Explorer. There are many reasons why you might need to do the same thing inside of an application. For example, if you are writing an application that installs another application or a set of data files, you will need to create directories to hold the files that you are installing. Listing 3.2 uses the CreateDirectory function to create a new directory.

Listing 3.2. Creates the specified directory
void Listing3_2()
{
  TCHAR szPath[MAX_PATH + 1];
  if(!GetTextResponse(_T("Enter Directory to Create:"),
        szPath, MAX_PATH))
     return;
  if(!CreateDirectory(szPath, 0))
     cout ≪ _T("Could not create directory: ")
          ≪ GetLastError();
}
Table 3.2. CreateDirectory—Creates a new directory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required