Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSFileDescriptions::CreateDataSourceDirectory
The CreateDataSourceDirectory method creates a new directory at the specified path, which can be used to store content.
Syntax
HRESULT CreateDataSourceDirectory( BSTR bstrPath );
Parameters
bstrPath
[in] BSTR containing the path and directory to create.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
| Return code | Number | Description |
| E_OUTOFMEMORY | 0x8007000E | There is insufficient memory to complete the function. |
| NS_E_DATA_SOURCE_ENUMERATION_NOT_SUPPORTED | 0xC00D1580L | The data source plug-in that the server is attempting to use to access the path referenced by bstrName does not support enumeration of files. |
| NS_E_SOURCE_PLUGIN_NOT_FOUND | 0xC00D157EL | The server was not able to find a data source plug-in to access the path referenced by bstrName. |
Remarks
This method requires the Network Service account to have write and browse access to the specified path.
Example Code
#include <windows.h>
#include <atlbase.h> // Includes CComBSTR.
#include "wmsserver.h"
// Declare variables and interfaces.
IWMSServer *pServer;
IWMSFileDescriptions *pFileDescriptions;
HRESULT hr;
CComBSTR bstrPath;
// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
NULL,
CLSCTX_ALL,
IID_IWMSServer,
(void **)&pServer);
if (FAILED(hr)) goto EXIT;
// Retrieve a pointer to an IWMSFileDescriptions interface.
bstrPath = "file://c:\\wmpub\\wmroot";
hr = pServer->get_FileDescriptions(bstrPath,
WMS_FILE_UNSPECIFIED,
&pFileDescriptions);
if (FAILED(hr)) goto EXIT;
// Create a new directory.
bstrPath = "file://c:\\wmpub\\wmroot\\NewDirectory";
hr = pFileDescriptions->CreateDataSourceDirectory(bstrPath);
if (FAILED(hr)) goto EXIT;
EXIT:
// TODO: Release temporary COM objects and uninitialize COM.
Requirements
Header: wmsserver.h.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
| Previous | Next |