Microsoft KB Archive/815631

= INFO: GetRequestedRuntimeVersionForCLSID API =

Article ID: 815631

Article Last Modified on 1/19/2004

-

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.</li></ul> </li></ul>

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

Keywords: kbinfo kbcominterop KB815631

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.