急!
解决方案 »
- MFC对话框上加IE控件,在控件范围内加一个按钮总是被覆盖
- 服务器控制带宽问题
- 如何实现EDIT编辑框换行??用“\n”好想不可以啊,急在线等!!
- 请教如何响应鼠标点击任务栏图标时,能使应用程序最小化
- 打包工具自动卸载不了service?
- 谁有网络通信的源程序?或讲解原理,制作手段,又说推荐站点!
- AT 指令接收短信问题
- 急!为什么在Dll中无法调用AfxGetInstanceHandle()函数
- 关于驱动的一个浅显的概念性问题
- ORA01157 请教
- 怪题,怪题
- vc做的DLL在PB中调用出问题,invalid stack pointer on return from function call
//以下摘自MSDN
// The pointer to my rich edit control.
extern CRichEditCtrl* pmyRichEditCtrl;
// A pointer to a printer DC.
extern CDC* pMyPrinterDC;FORMATRANGE fr;// Get the page width and height from the printer.
long lPageWidth = ::MulDiv(pMyPrinterDC->GetDeviceCaps(PHYSICALWIDTH),
1440, pMyPrinterDC->GetDeviceCaps(LOGPIXELSX));
long lPageHeight = ::MulDiv(pMyPrinterDC->GetDeviceCaps(PHYSICALHEIGHT),
1440, pMyPrinterDC->GetDeviceCaps(LOGPIXELSY));
CRect rcPage(0, 0, lPageWidth, lPageHeight);// Format the text and render it to the printer.
fr.hdc = pMyPrinterDC->m_hDC;
fr.hdcTarget = pMyPrinterDC->m_hDC;
fr.rc = rcPage;
fr.rcPage = rcPage;
fr.chrg.cpMin = 0;
fr.chrg.cpMax = -1;
pmyRichEditCtrl->FormatRange(&fr, TRUE);// Update the display with the new formatting.
RECT rcClient;
pmyRichEditCtrl->GetClientRect(&rcClient);
pmyRichEditCtrl->DisplayBand(&rcClient);