Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: exception from C function? Pin
George_George27-Jan-08 19:10
George_George27-Jan-08 19:10 
GeneralRe: exception from C function? Pin
Maxwell Chen27-Jan-08 19:27
Maxwell Chen27-Jan-08 19:27 
GeneralRe: exception from C function? Pin
George_George27-Jan-08 19:34
George_George27-Jan-08 19:34 
Generalnew invokes VirtualAlloc Pin
George_George27-Jan-08 15:59
George_George27-Jan-08 15:59 
Generalhelp Pin
gentleguy27-Jan-08 15:47
gentleguy27-Jan-08 15:47 
GeneralRe: help Pin
Luc Pattyn27-Jan-08 16:23
sitebuilderLuc Pattyn27-Jan-08 16:23 
GeneralRe: help Pin
Cranky27-Jan-08 22:36
Cranky27-Jan-08 22:36 
QuestionPrinting text fields onto a form Pin
Henri27-Jan-08 13:36
Henri27-Jan-08 13:36 
I am trying to print (text) fields onto a form. so I need to specify to my print fumction the exact x and y coordinates. The following code shows what I tried to do. I specify the coordinates but it prints a bit off not falling into the boxes of the from. I tried accounting for printer margins and still cannot get it to properly print. What am doing wrong ? For that matter is there a better way ?

Here are parts of relevant code.

omap = pDC->SetMapMode (MM_TEXT);
sx = pDC->GetDeviceCaps (LOGPIXELSX); // x axis pixels per inch
yx = pDC->GetDeviceCaps (LOGPIXELSY); // y axis pixels per inch

xmargin = pDC->GetDeviceCaps (112); // Left margin
ymargin = pDC->GetDeviceCaps (113); // Top margin

r_font.CreateFont (-Size, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, 0,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Courier New");

SelectFont (&r_font);

// to move half inch in and half inch down xpos would be sx/2
// and yx/2 (not accounting for printing margins). If accounting
// then factor in xmargin and ymargin.
TextOut (xpos, ypos, str, sz);
Thanks
I am using Visual C++ 5.0
GeneralRe: Printing text fields onto a form Pin
Mark Salsbery27-Jan-08 13:55
Mark Salsbery27-Jan-08 13:55 
GeneralRe: Printing text fields onto a form Pin
Nitheesh George27-Jan-08 17:33
Nitheesh George27-Jan-08 17:33 
GeneralRe: Printing text fields onto a form Pin
Henri6-Feb-08 5:30
Henri6-Feb-08 5:30 
Questionneed a lil help with hang man program Pin
Flash042927-Jan-08 13:29
Flash042927-Jan-08 13:29 
GeneralRe: need a lil help with hang man program Pin
Iain Clarke, Warrior Programmer27-Jan-08 23:55
Iain Clarke, Warrior Programmer27-Jan-08 23:55 
QuestionHow to prevent the list box of the combo box appear when catching the CBN_DROPDOWN message? Pin
Francisco José Sen del Prado27-Jan-08 13:29
Francisco José Sen del Prado27-Jan-08 13:29 
GeneralRe: How to prevent the list box of the combo box appear when catching the CBN_DROPDOWN message? Pin
Nitheesh George27-Jan-08 17:42
Nitheesh George27-Jan-08 17:42 
GeneralRe: How to prevent the list box of the combo box appear when catching the CBN_DROPDOWN message? Pin
Hamid_RT27-Jan-08 20:45
Hamid_RT27-Jan-08 20:45 
GeneralRe: How to prevent the list box of the combo box appear when catching the CBN_DROPDOWN message? Pin
Francisco José Sen del Prado27-Jan-08 20:50
Francisco José Sen del Prado27-Jan-08 20:50 
GeneralRe: How to prevent the list box of the combo box appear when catching the CBN_DROPDOWN message? Pin
Hamid_RT27-Jan-08 21:10
Hamid_RT27-Jan-08 21:10 
GeneralVideo Files to VCD\DVD Conversion Pin
Akin Ocal27-Jan-08 11:40
Akin Ocal27-Jan-08 11:40 
GeneralFile IO using Assembly and C Pin
Umer Sheikh27-Jan-08 10:27
Umer Sheikh27-Jan-08 10:27 
GeneralRe: File IO using Assembly and C Pin
Luc Pattyn27-Jan-08 11:51
sitebuilderLuc Pattyn27-Jan-08 11:51 
GeneralRe: File IO using Assembly and C Pin
Umer Sheikh27-Jan-08 12:02
Umer Sheikh27-Jan-08 12:02 
GeneralRe: File IO using Assembly and C Pin
Mark Salsbery27-Jan-08 12:12
Mark Salsbery27-Jan-08 12:12 
GeneralRe: File IO using Assembly and C Pin
Umer Sheikh27-Jan-08 12:20
Umer Sheikh27-Jan-08 12:20 
GeneralRe: File IO using Assembly and C Pin
Umer Sheikh27-Jan-08 12:42
Umer Sheikh27-Jan-08 12:42 

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.