Click to return to the Web Content Management home page    
WpBindToSite Function     WpCreateSiteEx Function     Web Publishing Programmer...    
Web Workshop  |  Web Content Management

WpCreateSite Function


Creates a new site in the registry.

Syntax

DWORD WpCreateSite(
    LPTSTR szSiteName,
    LPTSTR szSiteLocalBaseDir,
    LPTSTR szSiteURL,
    LPTSTR szProviderCLSID,
    DWORD dwFlags
);

Parameters

szSiteName
Posting site name.
szSiteLocalBaseDir
Optional. Local base directory for the site. If NULL, then the local base directory feature is not used for the site.
szSiteURL
Posting site URL.
szProviderCLSID
Optional. CLSID as string, of the provider that will handle this site. If NULL, then this method will search for a posting information (postinfo) file or attempt to autobind to an appropriate provider.
dwFlags
Optional. Action flags. Possible values are:
WPF_USE_PROVIDER_PASSED
If WpCreateSite has been called and returned WEBPOST_ERROR_PROV_NOT_IN_POSTINFO, use this flag to have WpCreateSiteEx use the provider specified in szProviderCLSID even if there is a postinfo file and it does not list this provider.

Return Value

Returns one of the following values:

NO_ERRORSuccessful.
E_INVALIDARGOne of the arguments is invalid.
E_OUTOFMEMORYNot enough memory to create a new site in the registry.
WEBPOST_ERROR_AUTOBIND_FAILEDThe Web Publishing API was unable to automatically determine which service provider to use for this site.
WEBPOST_ERROR_CREATE_SITEAn error occurred while the Web Publishing API was creating the requested site.
WEBPOST_ERROR_EXTENDED_ERRORA Web Publishing extended error occurred. This means that the API received an error code that the API client may not be able to translate, so the API performed the translation and cached the error message for retrieval on a call to the WpGetErrorString method.
WEBPOST_ERROR_INIT_FAILEDAn error occurred while attempting to initialize the Web Publishing API DLL.
WEBPOST_ERROR_INVALID_POSTINFOInformational (nonfailure) result indicating that the postinfo file found on the server during site creation could not be parsed correctly. This error is only returned if the site creation is otherwise successful.
WEBPOST_ERROR_NO_EXT_ERROR_INFOAn extended error occurred in the Web Publishing API, but the error message could not be retrieved.
WEBPOST_ERROR_NO_POSTINFOInformational (nonfailure) result indicating that the postinfo file could not be retrieved during a site creation. This error is only returned if the site creation is otherwise successful.
WEBPOST_ERROR_POSTINFO_REQUIREDThis service provider requires a postinfo file on the server, and none could be found.
WEBPOST_ERROR_PROV_DLLThe Web Publishing API could not load the DLL for one of its service providers.
WEBPOST_ERROR_PROV_EPThe Web Publishing API could not locate a required entry point in one of its service providers.
WEBPOST_ERROR_SITE_EXISTSThe Web Publishing API could not create the requested site because a site with the same name already exists.

Example

The following example calls WpCreateSite to create a new site in the registry.

{
    HRESULT hResult = NOERROR;

    hResult = WpCreateSite("site1", NULL, "http://site1", NULL, 0);
}

Function Information

Windows NTUse version 4.0 and later.
WindowsUse Windows 95 and later.
HeaderDeclared in Wpapi.h
Import LibraryLink with WebPost.lib
Minimum availabilityInternet Explorer 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.