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_ERROR Successful. E_INVALIDARG One of the arguments is invalid. E_OUTOFMEMORY Not enough memory to determine the provider. WEBPOST_ERROR_BAD_PROV_PTR The Web Publishing API was not able to obtain a valid pointer to the requested service provider. WEBPOST_ERROR_EXTENDED_ERROR A 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_SITES An error occurred while the Web Publishing API was enumerating the sites on this system. WEBPOST_ERROR_NO_EXT_ERROR_INFO An extended error occurred in the Web Publishing API, but the error message could not be retrieved. WEBPOST_ERROR_PROV_CORRUPT The Web Publishing API could not retrieve all of the required service provider information. WEBPOST_ERROR_PROV_DLL The Web Publishing API could not load the DLL for one of its service providers. WEBPOST_ERROR_PROV_EP The Web Publishing API could not locate a required entry point in one of its service providers. WEBPOST_ERROR_SITE_CORRUPT The Web Publishing API could not retrieve all of the required site information.
Remarks
The site lookup procedure works as follows:
- If szSiteName and szSiteURL are both NULL or empty, return E_INVALIDARG.
- Registry lookup. If szSiteName is non-NULL/empty and WPF_NO_DIRECT_LOOKUP is not set:
- Get a site subkey.
- 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.
- If all subkeys have been enumerated, proceed to URL Lookup. Otherwise return to step 2-1.
- URL lookup. If szSiteURL is non-NULL/empty and WPF_NO_URL_LOOKUP is not set:
- Get a site subkey.
- 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.
- 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 NT Use version 4.0 and later. Windows Use Windows 95 and later. Header Declared in Wpapi.h Import Library Link with WebPost.lib Minimum availability Internet Explorer 4.0