다음을 통해 공유


IMMCVersionInfo::GetMMCVersion 메서드(mmc.h)

GetMMCVersion 메서드는 MMC 애플리케이션에 대한 버전 정보를 검색합니다.

구문

HRESULT GetMMCVersion(
  [out] long *pVersionMajor,
  [out] long *pVersionMinor
);

매개 변수

[out] pVersionMajor

버전 주 번호입니다. 예를 들어 *pVersionMajor 이 2를 반환하는 경우 MMC 버전 2.x가 실행되고 있습니다.

[out] pVersionMinor

버전 부 번호입니다. 예를 들어 *pVersionMinor 가 0을 반환하는 경우 MMC 버전 x.0이 실행되고 있습니다.

반환 값

성공하면 반환 값이 S_OK. 다른 반환 값은 오류 코드를 나타냅니다.

설명

IMMCVersionInfo 인터페이스는 MMC 2.0에 도입되었습니다. MMC 1.x가 설치된 경우 MMC 버전을 확인하는 방법에 대한 지침은 MMC 버전 번호 검색을 참조하세요.

예제

IMMCVersionInfo * pVersionInfo = NULL;
HRESULT   hr;

// Create an object of the MMCVersionInfo class.
hr = CoCreateInstance(CLSID_MMCVersionInfo,
                      NULL,
                      CLSCTX_INPROC_SERVER,
                      IID_IMMCVersionInfo,
                      (void**)&pVersionInfo);
if (S_OK != hr)
{
    // Error encountered.
    // If the system does not support MMCVersionInfo, report it.
    // This would occur if the system was running MMC 1.x.
    if (REGDB_E_CLASSNOTREG == hr)
        OutputDebugString(_T("MMCVersionInfo is not registered\n"));
    else
        // Another error was encountered.
        OutputDebugString(_T("Failed call to CoCreateInstance\n"));
}
else
{
    // Call the GetMMCVersion method.
    long lMajor, lMinor;
    hr = pVersionInfo->GetMMCVersion(&lMajor,
                                     &lMinor);
    if (S_OK != hr)
        OutputDebugString(_T("Failed call to GetMMCVersion\n"));
    else
    {
        OutputDebugString(_T("Success in GetMMCVersion\n"));
        // Use major and minor version information as required.
        // ...
    }
}
// Free the interface pointer.
if (NULL != pVersionInfo)
{
    pVersionInfo->Release();
    pVersionInfo = NULL;
}

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows Vista
지원되는 최소 서버 Windows Server 2008
대상 플랫폼 Windows
헤더 mmc.h
라이브러리 Mmc.lib
DLL Mmcndmgr.dll