다음을 통해 공유


IXpsOMObjectFactory::CreateColorProfileResource 메서드(xpsobjectmodel.h)

색 프로필 리소스 스트림에 액세스하는 데 사용되는 IXpsOMColorProfileResource 인터페이스를 만듭니다.

구문

HRESULT CreateColorProfileResource(
  [in]          IStream                    *acquiredStream,
  [in]          IOpcPartUri                *partUri,
  [out, retval] IXpsOMColorProfileResource **colorProfileResource
);

매개 변수

[in] acquiredStream

이 리소스와 연결할 읽기 전용 IStream 인터페이스입니다. 이 매개 변수는 NULL이 아니어야 합니다.

중요 이 스트림을 STA(Single-Threaded Apartment) 개체로 처리합니다. 를 다시 입력하지 마세요.
 

[in] partUri

이 리소스에 할당할 파트 이름을 포함하는 IOpcPartUri 인터페이스입니다.

[out, retval] colorProfileResource

IXpsOMColorProfileResource 인터페이스에 대한 포인터입니다.

반환 값

이 메서드는 HRESULT를 반환합니다. 가능한 값에는 다음 표의 값이 포함되지만 이에 국한되지는 않습니다. 이 표에 나열되지 않은 XPS 문서 API 반환 값에 대한 자세한 내용은 XPS 문서 오류를 참조하세요.

반환 코드 Description
S_OK
메서드가 성공했습니다.
E_POINTER
acquiredStream, partUri 또는 colorProfileResourceNULL입니다.

설명

다음 코드 예제에서는 이 메서드를 사용하여 새 인터페이스를 만드는 방법을 보여 줍니다.


IXpsOMColorProfileResource    *newInterface;
IOpcPartUri                   *partUri;

// Note the implicit requirement that CoInitializeEx 
//  has previously been called from this thread.

hr = CoCreateInstance(
    __uuidof(XpsOMObjectFactory),
    NULL,
    CLSCTX_INPROC_SERVER,
    _uuidof(IXpsOMObjectFactory),
    reinterpret_cast<LPVOID*>(&xpsFactory)
    );

if (SUCCEEDED(hr))
{
    // The partUriString and acquiredStream variables 
    //   are defined outside of this example.
    hr = xpsFactory->CreatePartUri(
        partUriString, 
        &partUri);
    if (SUCCEEDED(hr))
    {
        hr = xpsFactory->CreateColorProfileResource (
            acquiredStream, 
            partUri,
            &newInterface);
        if (SUCCEEDED(hr))
        {
            // use newInterface

            newInterface->Release();
        }
        partUri->Release();
    }
    xpsFactory->Release();
}
else
{
    // evaluate HRESULT error returned in hr
}

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows 7, Windows Vista SP2 및 Windows Vista용 플랫폼 업데이트 [데스크톱 앱 | UWP 앱]
지원되는 최소 서버 Windows Server 2008 R2, Windows Server 2008 SP2 및 Windows Server 2008용 플랫폼 업데이트 [데스크톱 앱 | UWP 앱]
대상 플랫폼 Windows
헤더 xpsobjectmodel.h

추가 정보

IOpcPartUri

IXpsOMColorProfileResource

IXpsOMObjectFactory

XML Paper Specification

XPS 문서 오류