Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Using Object Identifiers

Windows CE 3.0

The following code example shows how to retrieve data from the object store or mounted volume by using the Windows CE object identifier.

void UsingCeOidGetInfo (void)
{
  CEOID CeOid;            // Object identifier
  PCEGUID pceguid;        // GUID of the mounted volume
  CEOIDINFO CeObjectInfo; // Structure into which to retrieve
                          // object data
  TCHAR szMsg[200];       // String to use with object data

  // Assign to pceguid the CEGUID of the mounted volume
  // on which the object resides.
  // ...

  // Assign to CeOid the object identifier of the object about which
  // you want to get data.
  // ...

  if (CeOidGetInfoEx (pceguid, CeOid, &CeObjectInfo))
  {
    switch (CeObjectInfo.wObjType)
    {
      case OBJTYPE_FILE:
        wsprintf (szMsg, TEXT("Object is a file: %s"),
                  CeObjectInfo.infFile.szFileName);
        break;

      case OBJTYPE_DIRECTORY:
        wsprintf (szMsg, TEXT("Object is a directory: %s"),
                  CeObjectInfo.infDirectory.szDirName);
        break;

      case OBJTYPE_DATABASE:
        wsprintf (szMsg, TEXT("Object is a database: %s"),
                  CeObjectInfo.infDatabase.szDbaseName);
        break;

      case OBJTYPE_RECORD:
        wsprintf (szMsg, TEXT("Object is a record"));
        break;

      case OBJTYPE_INVALID:
        wsprintf (szMsg,
                  TEXT("The object store does not contain a valid ")
                  TEXT("object that has this object identifier."));
        break;

      default:
        wsprintf (szMsg, TEXT("Object is of unknown OBJTYPE"));
        break;
    }
  }
  else
  {
    // Your error-handling code goes here.

    if (GetLastError () == ERROR_INVALID_HANDLE)
      wsprintf (szMsg, TEXT("Invalid Object ID"));
    else
      wsprintf (szMsg, TEXT("Unknown error"));
  }
} // End of UsingCeOidGetInfo code

Show:
© 2014 Microsoft