IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

ListDrives Method

Lists the drives accessible by the user.

Syntax

ANSI (Cross Platform)
int ListDrives();

Unicode (Windows)
INT ListDrives();
- (void)listDrives;
#define MID_ONEDRIVE_LISTDRIVES 15

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_OneDrive_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method lists the drives accessible to the current user.

Calling this method will fire the DriveList event once for each drive, and will also populate the Drive* properties.

If there are still more drives available to list when this method returns, the DriveMarker property will be populated. Continue to call this method until DriveMarker is empty to accumulate all pages of results in the Drive* properties.

The ListDrivesScope configuration setting can be used to control which drives are listed; by default only drives the user directly owns are returned. Refer to ListDrivesScope for more information.

Note: For use-cases that only make use of the current user's default drive (e.g., when authenticated with a personal Microsoft account), there is no need to ever call ListDrives, set the Drive property, or use any of the class's other drive-related API members. By default, the Drive property and the GroupId and SiteId configuration settings are all empty, which causes the class to use the current user's default drive.

// DriveList event handler.
onedrive.OnDriveList += (s, e) => {
  Console.WriteLine(e.Name);
};

do {
  onedrive.ListDrives();

  for (int i = 0; i < onedrive.Drives.Count; i++) {
    // Process drives here.
  }
} while (!string.IsNullOrEmpty(onedrive.DriveMarker));

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 C++ Edition - Version 20.0 [Build 8265]