Click to return to the Networking, Protocols     
URL Monikers Functions     CoInternetCombineUrl Func...     URL Monikers Functions    
Web Workshop  |  Networking, Protocols & Data Formats

CoGetClassObjectFromURL Function


Returns a factory object for a given CLSID.

Syntax

HRESULT CoGetClassObjectFromURL(
    REFCLSID rclsid,
    LPCWSTR szCodeURL,
    DWORD dwFileVersionMS,
    DWORD dwFileVersionLS,
    LPCWSTR szContentType,
    LPBINDCTX pBindCtx,
    DWORD dwClsContext,
    LPVOID pvReserved,
    REFIID riid,
    VOID **ppv 
);

Parameters

rclsid
[in] CLSID of the ActiveX® object to be installed. If the value is CLSID_NULL, szContentType is used to determine the CLSID.
szCodeURL
[in] Address of a string value that contains the full URL of the code for the ActiveX object.
dwFileVersionMS
[in] Unsigned long integer value that contains the major version number for the object to be installed. If this value and the value for dwFileVersionLS are both 0xFFFFFFFF, it is assumed that the latest version of the code is always desired. This means that Internet Component Download will always attempt to download new code.
dwFileVersionLS
[in] Unsigned long integer value that contains the minor version number for the object to be installed. If this value and the value for dwFileVersionMS are both 0xFFFFFFFF, it is assumed that the latest version of the code is always desired. This means that Internet Component Download will always attempt to download new code.
szContentType
[in] Address of a string value that contains the MIME type to be understood by the installed ActiveX object. If rclsid is CLSID_NULL, this string is used to determine the CLSID of the object to be installed. Note that this parameter is useful only when trying to download a viewer for a particular media type, when the MIME type of media is known but the CLSID is not.
pBindCtx
[in] Address of the bind context to use for downloading/installing component code. Register IBindStatusCallback in this bind context to receive callbacks during the download and installation process.
dwClsContext
[in] Unsigned long integer value that specifies the execution context for the class object. This can be one of the values taken from the CLSCTX enumeration.
pvReserved
[in] Reserved. Must be set to NULL.
riid
[in] Reference indentifier of the interface to obtain on the factory object. Usually this interface is IClassFactory.
ppv
[out] Address of an interface pointer for synchronous calls, or NULL otherwise.

Return Value

Returns one of the following values:

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.

Remarks

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.

Function Information

Windows NT Use version 4.0. Implemented as a Unicode function.
Windows Use Windows 95 and later. Implemented as a Unicode function.
Header Urlmon.h
Import Library Urlmon.lib
Minimum availability Internet 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.