Click to return to the Web Content Management home page    
The Web Publishing API     WpCreateSite Function     Web Publishing Programmer...    
Web Workshop  |  Web Content Management

WpBindToSite Function


Attempts to determine the provider responsible for servicing the specified site based upon szSiteName and/or szSiteURL.

Syntax

DWORD WpBindToSite(
    HWND hWnd,
    LPTSTR szSiteName,
    LPTSTR szSiteURL,
    DWORD dwFlags,
    DWORD dwReserved,
    LPVOID * ppUnk
);

Parameters

hWnd
Optional. Window handle to receive focus upon completion of this API call. This can be NULL.
szSiteName
Posting site name. This can be NULL if a valid szSiteURL is given.
szSiteURL
Posting site URL. This can be NULL if a valid szSiteName is given.
dwFlags
Action flags. The possible values are:
WPF_NO_DIRECT_LOOKUP
Do not attempt to look up the site based on the posting site name. This has the same effect as a NULL or empty szSiteName.
WPF_NO_URL_LOOKUP
Do not attempt to look up the site based on the posting site URL. This has the same effect as a NULL or empty szSiteURL.
dwReserved
Reserved. This must be set to zero.
ppUnk
Address of an IUnknown pointer, which can be queried upon return to determine whether the service provider supports the old IWPSite or the new IWPProvider interface. This cannot be NULL.

Return Value

Returns one of the following values:

NO_ERRORSuccessful.
E_INVALIDARGOne of the arguments is invalid.
E_OUTOFMEMORYNot enough memory to determine the provider.
WEBPOST_ERROR_BAD_PROV_PTRThe Web Publishing API was not able to obtain a valid pointer to the requested service provider.
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_LIST_SITESAn error occurred while the Web Publishing API was enumerating the sites on this system.
WEBPOST_ERROR_NO_EXT_ERROR_INFOAn extended error occurred in the Web Publishing API, but the error message could not be retrieved.
WEBPOST_ERROR_PROV_CORRUPTThe Web Publishing API could not retrieve all of the required service provider information.
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_CORRUPTThe Web Publishing API could not retrieve all of the required site information.

Remarks

The site lookup procedure works as follows:

  1. If szSiteName and szSiteURL are both NULL or empty, return E_INVALIDARG.
  2. Registry lookup. If szSiteName is non-NULL/empty and WPF_NO_DIRECT_LOOKUP is not set:
    1. Get a site subkey.
    2. Check szSiteName for a match with the subkey name. If there is a match, get the site URL and call WppBindToSite into the indicated provider with the WPF_FORCE_BIND flag and return the interface pointer so obtained.
    3. If all subkeys have been enumerated, proceed to URL Lookup. Otherwise return to step 2-1.
  3. URL lookup. If szSiteURL is non-NULL/empty and WPF_NO_URL_LOOKUP is not set:
    1. Get a site subkey.
    2. Check whether the szSiteURL value of the subkey is a prefix of szSiteURL. If so, get the site name and call WppBindToSite into the indicated provider with the WPF_FORCE_BIND flag and return the interface pointer so obtained.
    3. If all subkeys have been enumerated, quit with error result. Otherwise return to step 3-1.

Example

The following example calls WpBindToSite to determine the provider responsible for servicing site1.

{
    HRESULT hResult = NOERROR;
    void *pUnknown;

    hResult = WpBindToSite(NULL, "site1", NULL, 0, 0, &pUnknown);
}

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.