Click here to Skip to main content
16,007,443 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to add help Pin
lucy31-Jul-02 10:12
lucy31-Jul-02 10:12 
Generalintegrate a visual c++ program into the internet explorer!!! Pin
Anonymous31-Jul-02 7:12
Anonymous31-Jul-02 7:12 
GeneralRe: integrate a visual c++ program into the internet explorer!!! Pin
pépé2-Aug-02 0:31
pépé2-Aug-02 0:31 
GeneralBuild does not work Pin
TheoE31-Jul-02 7:03
TheoE31-Jul-02 7:03 
Question while (!pRecordset->GetadoEOF ()).......no MSDN help on this? Pin
ns31-Jul-02 6:59
ns31-Jul-02 6:59 
AnswerRe: while (!pRecordset->GetadoEOF ()).......no MSDN help on this? Pin
Alex Mitchell31-Jul-02 7:12
Alex Mitchell31-Jul-02 7:12 
AnswerRe: while (!pRecordset->GetadoEOF ()).......no MSDN help on this? Pin
Ravi Bhavnani31-Jul-02 8:02
professionalRavi Bhavnani31-Jul-02 8:02 
GeneralAsk about how to use startdoc(), startpage() to print data on paper imediately. Pin
ooosawaddee331-Jul-02 6:54
ooosawaddee331-Jul-02 6:54 
I want to ask about how to use startdoc(), startpage() to print data on paper imediately then receive the next data and print imediately and receive the next data and print ......

Example : If I want to print this below data in first page imediately and after that I receive the other data and print imediately not like Microsoft word which must receive all data and print 1 time.

110011110

How to do that loop?

This below is my program want to do that.

If first data is 110011110

I change 1 in the above data to solid black (which have 2 pixel width and 4 pixel height) and 0 in the above data to solid white (which have 2 pixel width and 4 pixel height)

code:
------------------------------------------------------------

DOCINFO di ;
CPrintInfo printInfo ;
CString filename ;
CDC dc ;
CRect draw_area ;
CPrintDialog dlg(FALSE) ;

if (Dlg.DoModal() == IDCANCEL)
return ;

HDC hDC = dlg.GetPrinterDC() ;
if (hDC == NULL)
return ;

di.cbSize = sizeof(DOCINFO) ;
di.lpszDocName = "Document name"
di.lpszOutput = NULL ;

// prepare the print information structure
dc.Attach(hDC) ;
printInfo.m_bDirect = TRUE ;
printInfo.m_rectDraw.left = 0 ;
printInfo.m_rectDraw.right = dc.GetDeviceCaps(HORZRES) ;
printInfo.m_rectDraw.top = 0 ;
printInfo.m_rectDraw.bottom = dc.GetDeviceCaps(VERTRES) ;
draw_area = printInfo.m_rectDraw ;

dc.StartDoc(&di) ;

//receive first data
CString testline = "110011110" ;

int x = 0 ;
int y = 0 ;
int pos = 0 ;
// start printing the document

dc.StartPage() ;

CBrush brush;

// Creation of the brush with a black color

brush.CreateSolidBrush(RGB(0, 0, 0));

while (pos < testline.GetLength())
{
if ((testline.GetAt(pos)) == '1')
{

// Create a rectangle with coordinates x,y,x+2,y+4 corresponding with top, left, bottom, right
CRect Rectangle(x, y, x + 2, y + 4) ;

// Fill a rectangle in the current device context or DC
dc.FillRect(&Rectangle , &brush);

x += 2;
}

else if ((testline.GetAt(pos)) == '0'){

x += 2;
}
pos++ ;
}
y += 4 ;
x = 0 ;
pos = 0 ;

dc.EndPage() ;
printInfo.m_rectDraw = draw_area ;

//OnEndPrinting(&dc, &printInfo);
dc.EndDoc() ;
VERIFY(dc.DeleteDC()) ;

------------------------------------------------------------
GeneralRe: Ask about how to use startdoc(), startpage() to print data on paper imediately. Pin
ooosawaddee331-Jul-02 7:42
ooosawaddee331-Jul-02 7:42 
GeneralCTabCtrl: Remove from propertysheet Pin
DroogsAlex31-Jul-02 6:51
DroogsAlex31-Jul-02 6:51 
GeneralRe: CTabCtrl: Remove from propertysheet Pin
Joaquín M López Muñoz31-Jul-02 7:07
Joaquín M López Muñoz31-Jul-02 7:07 
QuestionNow why doesn't this COMPILE!?!?!? Pin
Tommy Svensson31-Jul-02 6:43
Tommy Svensson31-Jul-02 6:43 
AnswerRe: Now why doesn't this COMPILE!?!?!? Pin
Joaquín M López Muñoz31-Jul-02 6:47
Joaquín M López Muñoz31-Jul-02 6:47 
GeneralRe: Now why doesn't this COMPILE!?!?!? Pin
Tommy Svensson31-Jul-02 6:50
Tommy Svensson31-Jul-02 6:50 
GeneralRe: Now why doesn't this COMPILE!?!?!? Pin
Joaquín M López Muñoz31-Jul-02 6:57
Joaquín M López Muñoz31-Jul-02 6:57 
AnswerRe: Now why doesn't this COMPILE!?!?!? Pin
jeffluckett31-Jul-02 7:09
jeffluckett31-Jul-02 7:09 
GeneralRe: Now why doesn't this COMPILE!?!?!? Pin
Tommy Svensson31-Jul-02 7:16
Tommy Svensson31-Jul-02 7:16 
GeneralRe: Now why doesn't this COMPILE!?!?!? Pin
pépé2-Aug-02 0:35
pépé2-Aug-02 0:35 
AnswerRe: Now why doesn't this COMPILE!?!?!? Pin
Vagif Abilov2-Aug-02 0:46
professionalVagif Abilov2-Aug-02 0:46 
GeneralDialog Box & Property Sheet :: MFC Pin
valikac31-Jul-02 6:35
valikac31-Jul-02 6:35 
GeneralRe: Dialog Box & Property Sheet :: MFC Pin
Joaquín M López Muñoz31-Jul-02 6:43
Joaquín M López Muñoz31-Jul-02 6:43 
GeneralRe: Dialog Box & Property Sheet :: MFC Pin
valikac31-Jul-02 6:50
valikac31-Jul-02 6:50 
GeneralRe: Dialog Box & Property Sheet :: MFC Pin
Joaquín M López Muñoz31-Jul-02 6:55
Joaquín M López Muñoz31-Jul-02 6:55 
GeneralRe: Dialog Box & Property Sheet :: MFC Pin
valikac31-Jul-02 6:56
valikac31-Jul-02 6:56 
GeneralRe: Dialog Box & Property Sheet :: MFC Pin
Joaquín M López Muñoz31-Jul-02 6:59
Joaquín M López Muñoz31-Jul-02 6:59 

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.