Partager via


CoGetClassObjectFromURL

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function returns a factory object for a given class identifier (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 Microsoft 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 Uniform Resource Locator (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, the latest version of the code should always be installed. 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, the latest version of the code should always be installed. This means that Internet Component Download will always attempt to download new code.
  • szContentType
    [in] Address of a string value that contains the Multipurpose Internet Mail Extensions (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 and installing component code. An implementation of the IBindStatusCallback interface must be registered on this bind context before calling this function.
  • 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 identifier 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

This function returns one of the values shown in the following table.

Value Description

S_OK

The operation completed successfully and the ppv parameter contains the requested interface pointer.

E_NOINTERFACE

The requested 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.

Requirements

Header urlmon.h, urlmon.idl
Library urlmon.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later