怎么会出现“PaintHook” : 未声明的标识符错误

来源:百度知道 编辑:UC知道 时间:2024/06/07 03:56:43
我用的是msnd中的原代码啊
CPageSetupDialog psd( PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS |
PSD_ENABLEPAGEPAINTHOOK, this );

// Initialize margins
psd.m_psd.rtMargin.top = 1000;
psd.m_psd.rtMargin.left = 1250;
psd.m_psd.rtMargin.right = 1250;
psd.m_psd.rtMargin.bottom = 1000;
psd.m_psd.lpfnPagePaintHook = (LPPAGEPAINTHOOK)PaintHook;

if( IDOK == psd.DoModal() )
{
// Propagate changes to the app
AfxGetApp()->SelectPrinter(psd.m_psd.hDevNames, psd.m_psd.hDevMode);
}
else
TRACE("CommDlgExtendedError returned error %d from
CPageSetupDialog::DoModal().\n",
(int)CommDlgExtendedError() );

MSDN中的很多例子的源代码并不是独立的程序,只是一个完整程序中的一段,当然会有很多undeclared identifier。MSDN给出这些例子仅仅是为了说明某些特定的问题,要是给出完整程序的话太长喧宾夺主,所以只给出一段来,其中用到的外部变量通常都会给出说明。