DlgFont Example for C++ 5.0 and later

void CDialogs:: OnShowMotionBlurDlg ()
{
   int nRet; 
   CString strDlg; 
   m_pRasterImageEfxDlg->Bitmap = m_LeadRasterView.GetRaster ().GetBitmap ();
   m_pRasterImageEfxDlg->EnableZoomToFit= true; 
   
   m_pRasterImageEfxDlg->UIFlags = MOTIONBLUR_SHOW_PREVIEW |
                                           MOTIONBLUR_SHOW_TOOL_ZOOMLEVEL; 
 
   
   strDlg =m_pRasterKrnDlg->GetDlgString(MOTIONBLUR_IDSTR_CAPTION); 
   AfxMessageBox(strDlg); 
   
   m_pRasterKrnDlg->SetDlgString( MOTIONBLUR_IDSTR_CAPTION, "My Custom Caption");

   IFont * pFont = NULL; 
   CY size; 
   CString csFontName; 

   csFontName = _T("Bones");
   BSTR bstrFontName = csFontName.AllocSysString();

   IFontDisp * pFontDisp = m_pRasterKrnDlg->GetDlgFont();
   pFontDisp->QueryInterface(IID_IFont, (void **)&pFont); 
   pFont->put_Name(bstrFontName); 

   size.Hi = 0; 
   size.Lo = 9*10000L; //9 point

   pFont->put_Size(size); 

   IFontDisp * pMyFontDisp = NULL; 

   pFont->QueryInterface(IID_IFont, (void **)&pMyFontDisp); 
   m_pRasterKrnDlg->PutDlgFont(pMyFontDisp); 

   SysFreeString(bstrFontName); 
   pMyFontDisp->Release();
   pFont->Release();
   pFontDisp->Release();
      
   nRet = m_pRasterImageEfxDlg->ShowMotionBlurDlg ((long)this->m_hWnd); 
      
   if (nRet == 0 && m_pRasterImageEfxDlg->DialogStatus == DLG_OK) 
   {
      nRet = m_pRasterProc->MotionBlur (m_LeadRasterView.GetRaster (),
                                m_pRasterImageEfxDlg->Dimension
                                m_pRasterImageEfxDlg->Angle
                                m_pRasterImageEfxDlg->EnableUniDirectional
                                ); 
   }
}