INFO: GetRequestedRuntimeVersionForCLSID API (815631)



The information in this article applies to:

  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.1

SUMMARY

This article discusses the Microsoft .NET Framework GetRequestedRuntimeVersionForCLSID API.

MORE INFORMATION

The .NET Framework GetRequestedRuntimeVersionForCLSID API determines the versions of the run-time Component Object Model (COM) object requests. This API retrieves the version of the run-time specified shim that is hosted by the COM object request. This function receives the class identifier (CLSID). Next, the function retrieves a string. The string indicates the run-time version that loads when you activate a class. This function also retrieves the length of the version string. The prototype of the API is as follows:
STDAPI GetRequestedRuntimeVersionForCLSID(
	REFCLSID rclsid, 
	LPWSTR pVersion, 
	DWORD cchBuffer, 
	DWORD* dwLength, 
	CLSID_RESOLUTION_FLAGS dwResolutionFlags);

Parameters

The list for API parameters is as follows:
  • rclsid- [in] This parameter is the CLSID for the component.
  • pVersion- [out] This parameter points to a buffer that receives the version of the runtime COM object requests.
  • cchBuffer- [in] This parameter specifies the size of the pVersion buffer.
  • dwLength- [out] This parameter points to a value that receives the length of the pVersion buffer.

    If the buffer is too small, the function is not successful, and you recieve the following error:
    ERROR_INSUFFICIENT_BUFFER
    The dwLength parameter receives the required buffer size, including the terminating null character.
  • dwResolutionFlags- [in] This parameter can use either of the following flags:
    • CLSID_RESOLUTION_DEFAULT returns the latest version of the runtime COM object.
    • CLSID_RESOLUTION_REGISTERED returns the runtime version that a COM object requests based on the values in the registry.

Return Values

The following list explains the return values of the function. This function supports the standard return value E_INVALIDARG, and the following values:
  • S_OK

    The API returns the version information when it is successful.
  • ERROR_INSUFFICIENT_BUFFER

    The output buffer is too small to hold the whole string.
  • REGDB_E_CLASSNOTREG

    The class is not registered.

Requirements


To use the GetRequestedRuntimeVersionForCLSID API, include the following header file and library file:
  • Header file: Declared in mscoree.h; include mscoree.h
  • Library file: Use mscoree.lib

Modification Type:MajorLast Reviewed:1/19/2004
Keywords:kbCOMInterop kbinfo KB815631 kbAudDeveloper