Contents Index Topic Contents | ||
Previous Topic: The Web Publishing API Next Topic: WpCreateSite |
WpBindToSite
DWORD WpBindToSite( [in] HWND hWnd [in, string] LPTSTR szSiteName [in, string] LPTSTR szSiteURL [in] DWORD dwFlags [in] DWORD dwReserved [out] LPVOID * ppUnk );Attempts to determine the provider responsible for servicing the specified site based upon szSiteName and/or szSiteURL.
- Returns NO_ERROR if successful. Otherwise, returns an error code, which may be one of the following:
E_INVALIDARG E_OUTOFMEMORY WEBPOST_ERROR_LIST_SITES WEBPOST_ERROR_SITE_CORRUPT WEBPOST_ERROR_PROVCLSID_UNKNOWN WEBPOST_ERROR_PROV_CORRUPT WEBPOST_ERROR_PROV_DLL WEBPOST_ERROR_PROV_EP WEBPOST_ERROR_BAD_PROV_PTR WEBPOST_ERROR_EXTENDED_ERROR WEBPOST_ERROR_NO_EXT_ERROR_INFO More information about these error codes can be found in Appendix B, Error Codes.
- hWnd
- Optional. Window handle to receive focus upon completion of this API call. May be NULL.
- szSiteName
- Posting site name. May be NULL if valid szSiteURL is given.
- szSiteURL
- Posting site URL. May be NULL if valid szSiteName is given.
- dwFlags
- Action flags. Possible values are shown in the following table.
Value Meaning 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. 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. May not be NULL.
The site lookup procedure works as follows:
- If szSiteName and szSiteURL are both either 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.
Examples
C/C++{ HRESULT hResult = NOERROR; void *pUnknown; hResult = WpBindToSite(NULL, "site1", NULL, 0, 0, &pUnknown); }
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.