다음을 통해 공유


IADsPrintJob 속성 메서드

IADsPrintJob 인터페이스에 대한 속성 메서드는 다음 표에 설명된 속성을 가져오거나 설정합니다. 자세한 내용은 Interface 속성 메서드를 참조하세요.

속성

설명

인쇄 작업에 대한 설명입니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_Description(
  [out] BSTR* pbstrDescription
);
HRESULT put_Description(
  [in] BSTR bstrDescription
);

HostPrintQueue

인쇄 작업을 처리하는 인쇄 큐의 ADsPath 문자열입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_HostPrintQueue(
  [out] BSTR* pbstrHostPrintQueue
);

알림

작업이 완료될 때 사용자에게 알림을 받을 수 있습니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_Notify(
  [out] BSTR* pbstrNotify
);
HRESULT put_Notify(
  [in] BSTR bstrNotify
);

NotifyPath

인쇄 작업이 완료될 때 알림을 받을 사용자 개체의 ADsPath 문자열입니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_NotifyPath(
  [out] BSTR* pbstrNotifyPath
);
HRESULT put_NotifyPath(
  [in] BSTR bstrNotifyPath
);

우선 순위

인쇄 작업의 우선 순위입니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: LONG

// C++ method syntax
HRESULT get_Priority(
  [out] LONG* plPriority
);
HRESULT put_Priority(
  [in] LONG lPriority
);

크기

인쇄 작업의 크기(바이트)입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: LONG

// C++ method syntax
HRESULT get_Size(
  [out] LONG* plSize
);

StartTime

인쇄 작업을 시작해야 하는 가장 빠른 시간입니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: DATE

// C++ method syntax
HRESULT get_StartTime(
  [out] DATE* pdateStartTime
);
HRESULT put_StartTime(
  [in] DATE dateStartTime
);

TimeSubmitted

작업이 큐에 제출된 시간입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: DATE

// C++ method syntax
HRESULT get_TimeSubmitted(
  [out] DATE* pdateTimeSubmitted
);

TotalPages

인쇄 작업의 총 페이지 수입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: LONG

// C++ method syntax
HRESULT get_TotalPages(
  [out] LONG* plTotalPages
);

UntilTime

인쇄 작업을 시작해야 하는 최신 시간입니다.

액세스 형식: 읽기/쓰기

스크립팅 데이터 형식: DATE

// C++ method syntax
HRESULT get_UntilTime(
  [out] DATE* pdateUntilTime
);

사용자

인쇄 작업을 제출한 사용자의 이름입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_User(
  [out] BSTR* pbstrUser
);

UserPath

이 인쇄 작업을 제출한 사용자 개체의 ADsPath 문자열입니다.

액세스 형식: 읽기 전용

스크립팅 데이터 형식: BSTR

// C++ method syntax
HRESULT get_UserPath(
  [out] BSTR* pbstrUserPath
);

예제

다음 코드 예제에서는 인쇄 작업 개체의 속성으로 작업하는 방법을 보여줍니다.

Dim pqo As IADsPrintQueueOperations
Dim pj As IADsPrintJob
On Error GoTo Cleanup

Set pqo = GetObject("WinNT://aMachine/aPrinter")
For Each pj In pqo.PrintJobs
    MsgBox "Host Printer: " & pj.HostPrintQueue
    MsgBox "Job description: " & pj.Description
    MsgBox "job requester: " & pj.User 
Next

Cleanup:
    If (Err.Number<>0) Then
        MsgBox("An error has occurred. " & Err.Number)
    End If
    Set pqo = Nothing
    Set pj = Nothing

다음 코드 예제에서는 인쇄 작업 개체의 속성으로 작업하는 방법을 보여줍니다.

IADsPrintQueueOperations *pqo = NULL;
IADsPrintJob *pJob = NULL;
HRESULT hr = S_OK;
BSTR bstr = NULL;
VARIANT var;
ULONG lFetch = 0;
IDispatch *pDisp = NULL;
IADsCollection *pColl = NULL;
IUnknown *pUnk = NULL;
LPWSTR adsPath =L"WinNT://aMachine/aPrinter";

VariantInit(&var);

hr = ADsGetObject(adsPath, 
                  IID_IADsPrintQueueOperations, 
                  (void**)&pqo);
if(FAILED(hr)){goto Cleanup;}


hr = pqo->PrintJobs(&pColl);

// Enumerate print jobs. Code omitted.

hr = pColl->get__NewEnum(&pUnk);
if(FAILED(hr)){goto Cleanup;}


IEnumVARIANT *pEnum;
hr = pUnk->QueryInterface(IID_IEnumVARIANT,(void**)&pEnum);
if(FAILED(hr)){goto Cleanup;}


// Now Enumerate.
hr = pEnum->Next(1, &var, &lFetch);
if(FAILED(hr)){goto Cleanup;}

while(hr == S_OK)
{
    if (lFetch == 1)    
    {
        pDisp = V_DISPATCH(&var);
        pDisp->QueryInterface(IID_IADsPrintJob, (void**)&pJob);

        pJob->get_HostPrintQueue(&bstr);
        printf("HostPrintQueue: %S\n",bstr);
        SysFreeString(bstr);

        pJob->get_Description(&bstr);
        printf("Print job name: %S\n",bstr);
        SysFreeString(bstr);

        pJob->get_User(&bstr);
        printf("Requester: %S\n",bstr);
        SysFreeString(bstr);

        pJob->Release();
    }
    pDisp->Release();
    VariantClear(&var);
    hr = pEnum->Next(1, &var, &lFetch);
};

Cleanup:
    if(pEnum) pEnum->Release();
    if(pUnk) pUnk->Release();
    if(pColl) pColl->Release();
    if(pqo) pqo->Release();

요구 사항

요구 사항
지원되는 최소 클라이언트
Windows Vista
지원되는 최소 서버
Windows Server 2008
헤더
Iads.h
DLL
Activeds.dll
IID
IID_IADsPrintJob 32FB6780-1ED0-11CF-A988-00AA006BC149로 정의됩니다.

추가 정보

IADsPrintJob

Interface 속성 메서드