The SmsCreateFolder creates a new folder of the specified type.
SMS_STATUS SmsCreateFolder(
HANDLE hParent, // Handle to parent folder or container.
DWORD fType, // Type of folder to create.
const char *pszFolderID,
// Identifier to assign to the new folder.
HANDLE *phFolder // Pointer to handle to receive the folder handle.
);
F_PACKAGE
F_WCL
F_PROGITEM
F_INSTALLJOB
F_SRVINSTALLJOB
F_REMPKGJOB
F_INVENTORY
The SmsCreateFolder function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns one of the following manifest constants:
Folders are created in the context of a parent, that is, folders are always created within a container or a parent folder. In addition, some folder types support creation and others do not (see the preceding list). Your application can create a new folder only if the folder's type supports creation.
After a new folder has been created, the folder is empty, that is, it has no scalars set within it. Your application must set the scalars for the new folder. Using the SmsDescribeFolder function, your application can retrieve the list of scalars for a folder. Using the SmsSetScalar function, your application can set the value for each scalar in the new folder. A new folder also does not contain any subfolders. Your application can use the SmsCreateFolder function to add subfolders to the new folder.
In addition, a new folder created by SmsCreateFolder is not linked to its parent folder (your application must use the SmsLinkFolder function to link a new folder to its parent). Linking associates the new folder to its parent within your application's memory—the folder is not written to the site database.
To add the new folder to the site database, your application must use the SmsCommitFolder function to write the folder to the database.
Note that when your application creates a folder, it has created an instance of a new folder. To deallocate the memory for the new folder, your application must use SmsCloseFolder to close the folder.
SmsCloseFolder, SmsCommitFolder, SmsDescribeFolder, SmsLinkFolder, SmsSetScalar