Click here to Skip to main content
15,917,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC CRichEditView-like view with columns Pin
includeh1015-Feb-03 1:22
includeh1015-Feb-03 1:22 
GeneralRe: MFC CRichEditView-like view with columns Pin
Anna-Jayne Metcalfe15-Feb-03 1:35
Anna-Jayne Metcalfe15-Feb-03 1:35 
GeneralRe: MFC CRichEditView-like view with columns Pin
Archigal15-Feb-03 1:35
Archigal15-Feb-03 1:35 
GeneralRe: MFC CRichEditView-like view with columns Pin
Anna-Jayne Metcalfe15-Feb-03 2:07
Anna-Jayne Metcalfe15-Feb-03 2:07 
GeneralRe: MFC CRichEditView-like view with columns Pin
Archigal15-Feb-03 2:33
Archigal15-Feb-03 2:33 
GeneralRe: MFC CRichEditView-like view with columns Pin
Anna-Jayne Metcalfe15-Feb-03 2:44
Anna-Jayne Metcalfe15-Feb-03 2:44 
GeneralRe: MFC CRichEditView-like view with columns Pin
Archigal15-Feb-03 3:30
Archigal15-Feb-03 3:30 
GeneralRe: MFC CRichEditView-like view with columns Pin
Anna-Jayne Metcalfe15-Feb-03 3:34
Anna-Jayne Metcalfe15-Feb-03 3:34 
GeneralRe: MFC CRichEditView-like view with columns Pin
Archigal15-Feb-03 21:01
Archigal15-Feb-03 21:01 
GeneralRe: MFC CRichEditView-like view with columns Pin
Anna-Jayne Metcalfe15-Feb-03 23:19
Anna-Jayne Metcalfe15-Feb-03 23:19 
Generalreadlines Pin
Dennis L14-Feb-03 22:51
Dennis L14-Feb-03 22:51 
GeneralRe: readlines Pin
Chintan14-Feb-03 23:33
Chintan14-Feb-03 23:33 
GeneralRe: readlines Pin
Anonymous15-Feb-03 10:49
Anonymous15-Feb-03 10:49 
GeneralPassing data values from Document class to View class in MDI. Pin
Neel Abraham14-Feb-03 19:57
Neel Abraham14-Feb-03 19:57 
GeneralRe: Passing data values from Document class to View class in MDI. Pin
includeh1015-Feb-03 0:09
includeh1015-Feb-03 0:09 
Generalsend a WAV file to modem Pin
Mehr14-Feb-03 18:49
Mehr14-Feb-03 18:49 
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 

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.