WpBindToSiteWpBindToSite*
*



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.

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:

  1. If szSiteName and szSiteURL are both either 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.

Examples
C/C++

{
	HRESULT hResult = NOERROR;
	void *pUnknown;

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

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.