다음을 통해 공유


CRichEditCtrl::SetTargetDevice

WYSIWYG을 사용 하는 대상 장치 및 선 두께 설정 (볼 것입니다)이 서식 CRichEditCtrl 개체입니다.

BOOL SetTargetDevice(
   HDC hDC,
   long lLineWidth 
);
BOOL SetTargetDevice(
   CDC& dc,
   long lLineWidth 
);

매개 변수

  • hDC
    새 대상 장치에 대 한 장치 컨텍스트를 처리 합니다.

  • lLineWidth
    서식 지정에 사용할 줄 너비입니다.

  • dc
    CDC 새 대상 장치에 대 한.

반환 값

성공 하면 0이 아닌. 그렇지 않으면 0입니다.

설명

이 함수는 성공 하면 rich edit 컨트롤 장치를 소유한 컨텍스트를 매개 변수로 전달 합니다.이런 경우 호출 하는 함수는 디바이스 컨텍스트를 파괴 해서는 안됩니다.

자세한 내용은 EM_SETTARGETDEVICE 에 있는 Windows SDK.

예제

// First obtain a pointer to a printer DC.
CPageSetupDialog psDlg;
if (IDOK == psDlg.DoModal())
{
   CDC* pMyPrinterDC = CDC::FromHandle(psDlg.CreatePrinterDC());

   // Get line width information from the printer.
   long lLineWidth = ::MulDiv(pMyPrinterDC->GetDeviceCaps(PHYSICALWIDTH),
       1440, pMyPrinterDC->GetDeviceCaps(LOGPIXELSX));

   // Set the printer as the target device.
   m_myRichEditCtrl.SetTargetDevice(*pMyPrinterDC, lLineWidth);   

   pMyPrinterDC->DeleteDC();
}

요구 사항

헤더: afxcmn.h

참고 항목

참조

CRichEditCtrl 클래스

계층 구조 차트

CRichEditCtrl::FormatRange

CRichEditCtrl::DisplayBand