Click here to Skip to main content
15,891,858 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to send and receive data use the same port? Pin
darkcloud.42o30-Jun-06 17:46
darkcloud.42o30-Jun-06 17:46 
AnswerRe: How to send and receive data use the same port? [modified] Pin
darkcloud.42o30-Jun-06 17:56
darkcloud.42o30-Jun-06 17:56 
QuestionGraphics like VB.NET Pin
spelltwister30-Jun-06 14:44
spelltwister30-Jun-06 14:44 
AnswerRe: Graphics like VB.NET Pin
led mike1-Jul-06 19:40
led mike1-Jul-06 19:40 
GeneralRe: Graphics like VB.NET Pin
spelltwister2-Jul-06 17:08
spelltwister2-Jul-06 17:08 
GeneralRe: Graphics like VB.NET Pin
led mike2-Jul-06 19:27
led mike2-Jul-06 19:27 
QuestionGetting # Pages to use for SetMaxPage() Pin
cwbenson30-Jun-06 7:30
cwbenson30-Jun-06 7:30 
AnswerRe: Getting # Pages to use for SetMaxPage() Pin
softwaremonkey30-Jun-06 9:26
softwaremonkey30-Jun-06 9:26 
You should be able to calculate the number of pages inside OnBeginPrinting(). Call pDC->GetDeviceCaps(VERTSIZE) to find the vertical height of the paper in mm. You should then be able to calculate the number of pages from the number of lines, the font size and the page size. Here is what I do...

void CActionManView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
m_nHeight = 32; Font size
m_normalFont.CreateFont(m_nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,"Ariel");

pDC->SetMapMode(MM_LOMETRIC); // 0.1mm units
int height = pDC->GetDeviceCaps(VERTSIZE) * 10; // Get size of page in mm and scal to 0.1mm units
m_nItemsPerPage = height / m_nHeight; // Calculate items per page
m_nItemsPerPage -= 10; // Allow for header/footer
unsigned int nNumPages = (GetPrintableTaskCount() /m_nItemsPerPage)+ 1;
pInfo->SetMaxPage(nNumPages);
m_nPrintItemIndex = 0;
}

Hope this helps.

Tony Wink | ;)

QuestionCString to long Pin
RockyJames30-Jun-06 7:04
RockyJames30-Jun-06 7:04 
AnswerRe: CString to long Pin
Chris Losinger30-Jun-06 7:09
professionalChris Losinger30-Jun-06 7:09 
GeneralRe: CString to long Pin
RockyJames30-Jun-06 7:14
RockyJames30-Jun-06 7:14 
GeneralRe: CString to long Pin
Maximilien30-Jun-06 7:22
Maximilien30-Jun-06 7:22 
GeneralRe: CString to long Pin
RockyJames30-Jun-06 7:32
RockyJames30-Jun-06 7:32 
GeneralRe: CString to long Pin
Zac Howland30-Jun-06 7:49
Zac Howland30-Jun-06 7:49 
GeneralRe: CString to long Pin
Zac Howland30-Jun-06 7:33
Zac Howland30-Jun-06 7:33 
GeneralRe: CString to long Pin
RockyJames30-Jun-06 7:45
RockyJames30-Jun-06 7:45 
GeneralRe: CString to long Pin
Zac Howland30-Jun-06 7:46
Zac Howland30-Jun-06 7:46 
GeneralRe: CString to long Pin
RockyJames30-Jun-06 7:50
RockyJames30-Jun-06 7:50 
GeneralRe: CString to long Pin
David Crow30-Jun-06 7:48
David Crow30-Jun-06 7:48 
Questioninvisible button Pin
aafcls30-Jun-06 6:55
aafcls30-Jun-06 6:55 
AnswerRe: invisible button Pin
Zac Howland30-Jun-06 7:03
Zac Howland30-Jun-06 7:03 
QuestionPrinting an SDI application Pin
jonesap530-Jun-06 5:57
jonesap530-Jun-06 5:57 
AnswerRe: Printing an SDI application Pin
Zac Howland30-Jun-06 6:03
Zac Howland30-Jun-06 6:03 
GeneralRe: Printing an SDI application Pin
jonesap530-Jun-06 10:13
jonesap530-Jun-06 10:13 
GeneralRe: Printing an SDI application Pin
Zac Howland3-Jul-06 3:38
Zac Howland3-Jul-06 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.