CreateLink Method
Creates a resource sharing link.
Syntax
QString CreateLink(bool bReadOnly);
Remarks
This method creates and returns a sharing link for the resource currently selected by RemoteId or RemotePath. The ReadOnly parameter controls whether the link provides view-only or editing access to the resource in question.
For OneDrive for Business and SharePoint Online resources, the CreateLinkScope configuration setting can also be used to control the access scope used to create the link.
// Create a read-only shared link for the given file. onedrive.RemotePath = "/work_stuff/serious_business/best_cat_pictures.zip"; string sharingUrl = onedrive.CreateLink(true);
Error Handling
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its 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.