Click here to Skip to main content
15,902,866 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSDI Limit ?? Pin
boon kian14-Feb-03 17:41
boon kian14-Feb-03 17:41 
AnswerRe: SDI Limit ?? Pin
Anna-Jayne Metcalfe15-Feb-03 1:13
Anna-Jayne Metcalfe15-Feb-03 1:13 
GeneralRe: SDI Limit ?? Pin
boon kian15-Feb-03 15:16
boon kian15-Feb-03 15:16 
GeneralRe: SDI Limit ?? Pin
Anna-Jayne Metcalfe15-Feb-03 23:18
Anna-Jayne Metcalfe15-Feb-03 23:18 
GeneralRe: SDI Limit ?? Pin
boon kian16-Feb-03 4:03
boon kian16-Feb-03 4:03 
GeneralRe: SDI Limit ?? Pin
Anna-Jayne Metcalfe16-Feb-03 5:13
Anna-Jayne Metcalfe16-Feb-03 5:13 
QuestionHow to print a String by printer? Pin
Nguyen Huynh Hung14-Feb-03 13:59
Nguyen Huynh Hung14-Feb-03 13:59 
AnswerRe: How to print a String by printer? Pin
xxhimanshu14-Feb-03 17:38
xxhimanshu14-Feb-03 17:38 
Wink | ;) check out..
http://www.codeproject.com/printing/lineprint.asp?print=true
or also see...
void
printClass::printString(CDC *dc, char *str, int x, int y)
{
CPrintInfo Info;
int w = dc->GetDeviceCaps(HORZRES);
int h = dc->GetDeviceCaps(VERTRES);
Info.m_rectDraw.SetRect(x,y, w, h);

CRect r = Info.m_rectDraw;

// Calculate the size of the rect but do not print
(void)dc->DrawText(str, strlen(str), r,
DT_CALCRECT|DT_WORDBREAK|DT_NOCLIP|DT_EXPANDTABS);

//print string
dc->DrawText(str, strlen(str), r,
DT_WORDBREAK|DT_NOCLIP|DT_EXPANDTABS);
}

void
printClass::printTestString()
{
CPrintDialog printDlg(FALSE);
CDC dc;
char *strTitle = "Title";

// ask the user to select a printer
if (printDlg.DoModal() == IDCANCEL) return;

dc.Attach(printDlg.GetPrinterDC());
dc.m_bPrinting = TRUE;

dc.SetMapMode(MM_TEXT);

DOCINFO di;
memset(&di, 0, sizeof (DOCINFO));

di.cbSize = sizeof (DOCINFO);

// application title appears in the spooler view
di.lpszDocName = strTitle;

// Begin a new print job
BOOL bPrintingOK = dc.StartDoc( &di );

dc.StartPage();

printString(&dc, "This is a test string", 0,0);

// end page
bPrintingOK = (dc.EndPage() > 0);
if (bPrintingOK) dc.EndDoc();
else dc.AbortDoc();

// detach the printer DC
dc.Detach();
}
cheers


Himanshu
QuestionHow Cool are void pointers? Pin
ursus zeta14-Feb-03 12:42
ursus zeta14-Feb-03 12:42 
AnswerRe: How Cool are void pointers? Pin
palbano14-Feb-03 13:02
palbano14-Feb-03 13:02 
AnswerRe: How Cool are void pointers? Pin
Nish Nishant14-Feb-03 15:55
sitebuilderNish Nishant14-Feb-03 15:55 
AnswerRe: How Cool are void pointers? Pin
includeh1015-Feb-03 0:35
includeh1015-Feb-03 0:35 
GeneralWell, hell,... Pin
ursus zeta18-Feb-03 7:36
ursus zeta18-Feb-03 7:36 
GeneralHelp with CMap Pin
Stefan Dahlin14-Feb-03 12:21
Stefan Dahlin14-Feb-03 12:21 
GeneralRe: Help with CMap Pin
Neville Franks14-Feb-03 12:37
Neville Franks14-Feb-03 12:37 
GeneralConfused About dlg.DoModal() Pin
Avantjer14-Feb-03 11:53
Avantjer14-Feb-03 11:53 
GeneralRe: Confused About dlg.DoModal() Pin
Rickard Andersson2014-Feb-03 11:56
Rickard Andersson2014-Feb-03 11:56 
GeneralRe: Confused About dlg.DoModal() Pin
Avantjer14-Feb-03 12:04
Avantjer14-Feb-03 12:04 
GeneralRe: Confused About dlg.DoModal() Pin
Rickard Andersson2014-Feb-03 12:11
Rickard Andersson2014-Feb-03 12:11 
GeneralRe: Confused About dlg.DoModal() Pin
Sean Cundiff14-Feb-03 12:21
Sean Cundiff14-Feb-03 12:21 
GeneralRe: Confused About dlg.DoModal() Pin
Avantjer14-Feb-03 12:26
Avantjer14-Feb-03 12:26 
GeneralRe: Confused About dlg.DoModal() Pin
don___14-Feb-03 15:14
sussdon___14-Feb-03 15:14 
GeneralStrange Array Problems, Please Please Help.. Pin
Ayush14-Feb-03 11:32
Ayush14-Feb-03 11:32 
GeneralRe: Strange Array Problems, Please Please Help.. Pin
valikac14-Feb-03 14:16
valikac14-Feb-03 14:16 
GeneralRe: Strange Array Problems, Please Please Help.. Pin
Ayush14-Feb-03 15:56
Ayush14-Feb-03 15:56 

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.