
This section describes the functions included in monikers, URLs, security zones, and pluggable protocols.
STDAPI CoGetClassObjectFromURL(
[in] REFCLSID rclsid,
[in] LPCWSTR szCodeURL,
[in] DWORD dwFileVersionMS,
[in] DWORD dwFileVersionLS,
[in] LPCWSTR szContentType,
[in] LPBINDCTX pBindCtx,
[in] DWORD dwClsContext,
[in] LPVOID pvReserved,
[in] REFIID riid,
[out] VOID ppv * *
);
Returns a factory object for a given CLSID.
| S_OK | The operation completed successfully and the ppv parameter contains the requested interface pointer. |
| E_NOINTERFACE | The desired interface pointer is not available. |
| MK_S_ASYNCHRONOUS | Component code will be downloaded and installed asynchronously. The client will receive notifications through the IBindStatusCallback interface registered on pBindCtx. |
If no CLSID is specified (CLSID_NULL), this function chooses the appropriate CLSID for interpreting the Internet mail extensions (MIME) type specified in szContentType. If the desired object is installed on the system, it is instantiated. Otherwise, the necessary code is downloaded and installed from the location specified in szCodeURL.
STDAPI CoInternetCombineUrl(
LPCWSTR pwzBaseUrl,
LPCWSTR pwzRelativeUrl,
DWORD dwCombineFlags,
LPWSTR pwzResult,
DWORD cchResult,
DWORD *pcchResult,
DWORD dwReserved
);
Combines a base and relative URL into a full URL.
| S_OK | Success. |
| S_FALSE | The buffer was too small to contain the resulting URL. |
| INET_E_DEFAULT_ACTION |
STDAPI CoInternetCompareUrl(
[in] LPCWSTR pwzUrl1,
[in] LPCWSTR pwzUrl2,
[in] DWORD dwCompareFlags
);
Compares two URLs and determines if they are equal.
Obsolete. Do not use.
Obsolete. Do not use.
STDAPI CoInternetGetProtocolFlags(
LPCWSTR pwzUrl,
DWORD *pdwFlags,
DWORD dwReserved
);
Retrieves the protocol flags for a specified URL.
HRESULT CoInternetGetSecurityURL(
LPCWSTR pwzUrl,
LPWSTR *ppwzSecUrl,
PSUACTION psuAction,
DWORD dwReserved
);
Retrieves the security URL for the specified URL.
STDAPI CoInternetGetSession(
DWORD dwSessionMode,
IInternetSession **ppIInternetSession,
DWORD dwReserved
);
Creates a session that allows temporary asynchronous pluggable protocols to be implemented and returns the IInternetSession interface of the session.
| S_OK | Successful. |
| E_OUTOFMEMORY | Not enough memory to create a session. |
| E_INVALIDARG | One of the arguments is invalid. |
STDAPI CoInternetParseUrl(
LPCWSTR pwzUrl,
PARSEACTION ParseAction,
DWORD dwFlags,
LPWSTR pszResult,
DWORD cchResult,
DWORD *pcchResult,
DWORD dwReserved
);
Parses URLs. (This is a helper API.)
| S_OK | Success. |
| S_FALSE | The buffer was too small to contain the resulting URL. |
| INET_E_DEFAULT_ACTION |
STDAPI CoInternetQueryInfo(
LPCWSTR pwzUrl,
QUERYOPTION QueryOption,
DWORD dwQueryFlags,
LPVOID pvBuffer,
DWORD cbBuffer,
DWORD *pcbBuffer,
DWORD dwReserved
);
Retrieves information related to the specified URL.
| S_OK | The information requested was retrieved successfully. |
| S_FALSE | The buffer was too small to store the information. |
| INET_E_QUERYOPTION_UNKNOWN | The option requested is unknown. |
HRESULT CopyBindInfo(
const BINDINFO *pcbiSrc,
BINDINFO *pcbiDest
);
Copies the given BINDINFO structure.
HRESULT CopyStgMedium(
const STGMEDIUM *pcstrgmedSrc,
STGMEDIUM *pstgmedDest
);
Copy the given STGMEDIUM structure.
HRESULT CreateAsyncBindCtx(
[in] DWORD dwReserved,
[in] IBindStatusCallback *pbsc,
[in] IEnumFORMATETC *penumfmtetc,
[out] IBindCtx **ppbc
);
Creates an asynchronous bind context for use with asynchronous monikers.
| S_OK | Success. |
| E_INVALIDARG | One or more parameters are invalid. |
| E_OUTOFMEMORY | The method ran out of memory and did not complete. |
This function automatically registers the IBindStatusCallback and the IEnumFORMATETC interfaces with the bind context. If the client does not want to receive certain notifications, it can choose to implement those callback methods as empty function stubs (returning E_NOTIMPL), and they should not be called.
The RegisterBindStatusCallback function can also be used to register callback interfaces in the bind context.
See also IBindStatusCallback, RegisterBindStatusCallback
STDAPI CreateAsyncBindCtxEx(
IBindCtx *pbc,
DWORD dwOptions,
IBindStatusCallback *pBSCb,
IEnumFORMATETC *pEnum,
IBindCtx **ppBC,
DWORD reserved
);
Creates an asynchronous bind context for use with asynchronous monikers.
HRESULT CreateFormatEnumerator(
[in] UINT cfmtetc,
[in] FORMATETC *rgfmtetc,
[out] IEnumFORMATETC **ppenumfmtetc
);
Creates an object that implements IEnumFORMATETC over a static array of FORMATETC structures.
See also RegisterFormatEnumerator, RevokeFormatEnumerator
STDAPI CreateURLBinding(
LPCWSTR lpszUrl,
IBindCtx *pbc,
IBinding **ppBdg
);
Creates an IBinding interface associated with the specified URL.
HRESULT CreateURLMoniker(
[in] IMoniker *pmkContext,
[in] LPWSTR szURL,
[out] IMoniker **ppmk
);
Creates a URL moniker from either a full URL string or from a base context URL moniker and a partial URL string.
| S_OK | Success. |
| E_OUTOFMEMORY | The operation ran out of memory. |
| MK_E_SYNTAX | A moniker could not be created because szURL does not correspond to valid URL syntax for a full or partial URL. This is uncommon, because most parsing of the URL occurs during binding and because the syntax for URLs is extremely flexible. |
STDAPI FindMediaType(
LPCSTR rgszTypes,
CLIPFORMAT *rgcfTypes
);
Retrieves the media type.
HRESULT FindMediaTypeClass(
[in] LPBC pbc,
[in] LPCSTR szType,
[out] CLSID *pclsID,
[in] DWORD dwReserved
);
Retrieves the CLSID for the specified media type.
See also RegisterMediaTypeClass, RegisterMediaTypes
FindMimeFromData(
LPBC pBC,
LPCWSTR pwzUrl,
LPVOID pBuffer,
DWORD cbSize,
LPCWSTR pwzMimeProposed,
DWORD dwMimeFlags,
LPWSTR *ppwzMimeOut,
DWORD dwReserved
);
Determines the MIME type from the data provided.
STDAPI GetClassURL(
LPCWSTR szURL,
CLSID *pClsID
);
Gets the class identification associated with the URL.
HRESULT IsAsyncMoniker(
[in] IMoniker *pmk
);
Tests if a moniker supports asynchronous binding.
A moniker implementation indicates that it is asynchronous by supporting the IAsyncMoniker interface, an empty interface that is just an implementation of IUnknown. The IsAsyncMoniker function tests for support of IAsyncMoniker and also handles composite monikers correctly.
See also IAsyncMoniker
HRESULT IsValidURL(
[in] LPBC pBC,
[in] LPCWSTR szURL,
[in] DWORD dwReserved
);
Determines if a specified string is a valid URL.
| S_OK | The szURL parameter contains a valid URL. |
| S_FALSE | The szURL parameter does not contain a valid URL. |
| E_INVALIDARG | One of the parameters is invalid. |
Relative URLs are not considered valid by this function.
HRESULT MkParseDisplayNameEx(
[in] IBindCtx*pbc,
[in] LPWSTR szDisplayName,
[out] ULONG *pcchEaten,
[out] IMoniker **ppmk
);
Given a string, returns a moniker of the object that the string denotes.
| S_OK | Success. |
| E_OUTOFMEMORY | The operation ran out of memory. |
| MK_E_SYNTAX | Parsing failed because szDisplayName could only be partially resolved into a moniker. In this case, pcchEaten has the number of characters that were successfully parsed into a moniker prefix. |
See also IParseDisplayName
HRESULT ObtainUserAgentString(
DWORD dwOption,
LPCSTR pcszUAOut,
DWORD *cbSize
);
Retrieve the user agent string in use.
HRESULT RegisterBindStatusCallback(
[in] IBindCtx *pbc,
[in] IBindStatusCallback *pbsc,
[out] IBindStatusCallback **ppbscPrevious,
[in] DWORD dwReserved
);
Registers a callback interface with an existing bind context.
| S_OK | Success. |
| E_INVALIDARG | One or more parameters are invalid. |
| E_OUTOFMEMORY | There was insufficient memory to register the callback with the bind context. |
The IBindStatusCallback interface passed into the pbsc parameter will receive callbacks on any binding operations using the bind context passed into the pbc paramter.
Only the last IBindStatusCallback interface that was registered to a particular bind context will receive callbacks. The implementation of IBindStatusCallback could pass the callbacks it receives to the previously registered IBindStatusCallback interface using the address of a pointer in the ppbscPrevious paramter.
See also IBindStatusCallback, RevokeBindStatusCallback
HRESULT RegisterFormatEnumerator(
[in] LPBC pBC,
[in] IEnumFORMATETC *pEFetc,
[in] DWORD reserved
);
Registers a FORMATETC enumerator object onto the given bind context.
The enumerator is used to determine what format types are preferred for the bind operation. Typically, the pEFetc parameter would be the pointer obtained through a call to CreateFormatEnumerator.
See also CreateFormatEnumerator, RevokeFormatEnumerator
HRESULT RegisterMediaTypeClass(
[in] LPBC pbc,
[in] UINT ctypes,
[in] LPCSTR *rgszTypes,
[in] CLSID *rgclsID,
[in] DWORD dwReserved
);
Registers a mapping of media types to CLSIDs to override the default mapping specified in the registry. The new mapping is used in calls to IMoniker::BindToObject when binding objects in the specified bind context.
This function is primarily used by moniker clients calling IMoniker::BindToObject to override the default registry mapping between MIME types and CLSIDs. In most cases, the default mapping provided in the registry is used. However, a Web browser might want the CLSID for its HTML viewer to be associated with .txt files without changing the default registry association for text files. The override is used for all bind operations using the specified bind context.
See also RegisterMediaTypes
HRESULT RegisterMediaTypes (
[in] UINT ctypes,
[in] LPCSTR *rgszTypes,
[out] CLIPFORMAT *rgcfTypes
);
Registers media type strings.
| Value | Meaning |
| CF_NULL | 0 |
| SZ_URLCONTEXT | (L"URL Context") |
| CFSTR_MIME_FRACTALS | (TEXT("application/fractals")) |
| CFSTR_MIME_POSTSCRIPT | (TEXT("application/postscript")) |
| CFSTR_MIME_RAWDATA | (TEXT("application/octet")) |
| CFSTR_MIME_AIIF | (TEXT("audio/aiif")) |
| CFSTR_MIME_BASICAUDIO | (TEXT("audio/basic")) |
| CFSTR_MIME_WAV | (TEXT("audio/wav")) |
| CFSTR_MIME_X_AIIF | (TEXT("audio/x-aiif")) |
| CFSTR_MIME_X_REALAUDIO | (TEXT("audio/x-pn-realaudio")) |
| CFSTR_MIME_X_WAV | (TEXT("audio/x-wav")) |
| CFSTR_MIME_BMP | (TEXT("image/bmp")) |
| CFSTR_MIME_GIF | (TEXT("image/gif")) |
| CFSTR_MIME_JPEG | (TEXT("image/jpeg")) |
| CFSTR_MIME_TIFF | (TEXT("image/tiff")) |
| CFSTR_MIME_XBM | (TEXT("image/xbm")) |
| CFSTR_MIME_X_BITMAP | (TEXT("image/x-bitmap")) |
| CFSTR_MIME_HTML | (TEXT("text/html")) |
| CFSTR_MIME_TEXT | (TEXT("text/plain")) |
| CFSTR_MIME_AVI | (TEXT("video/avi")) |
| CFSTR_MIME_MPEG | (TEXT("video/mpeg")) |
| CFSTR_MIME_QUICKTIME | TEXT("video/quicktime")) |
| CFSTR_MIME_X_MSVIDEO | (TEXT("video/x-msvideo")) |
| CFSTR_MIME_X_SGI_MOVIE | (TEXT("video/x-sgi-movie")) |
See also RegisterMediaTypeClass
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.