Impression Visual C++6

cs_mogala Messages postés 1 Date d'inscription vendredi 20 décembre 2002 Statut Membre Dernière intervention 5 novembre 2003 - 5 nov. 2003 à 09:29
marwanalfakih Messages postés 1 Date d'inscription samedi 21 avril 2012 Statut Membre Dernière intervention 21 avril 2012 - 21 avril 2012 à 02:01
Dans mon projet Vc6++, sur une form de type CDialog où se trouvent plusieurs controles, j'amerais ajouter un bouton qui me permetrait d'imprimer cette form.

Comment faire ?

Ou bien peut on ajouter un menu sur cette form ?

Merci d'avance.

1 réponse

marwanalfakih Messages postés 1 Date d'inscription samedi 21 avril 2012 Statut Membre Dernière intervention 21 avril 2012
21 avril 2012 à 02:01
void CImpression::OnOK()
{
// TODO: Add extra validation here


CPrintDialog dlgPrint(FALSE, PD_ALLPAGES,this);

if (dlgPrint.DoModal()==IDOK)
{
CDC dcPrint;
dcPrint.Attach(dlgPrint.GetPrinterDC());

DOCINFO myPrintJop;
myPrintJop.cbSize = sizeof(myPrintJop);
myPrintJop.lpszDocName = "MyPrintJop";
myPrintJop.lpszOutput =NULL;
myPrintJop.lpszDatatype = NULL;
myPrintJop.fwType = NULL;
if (dcPrint.StartDoc(&myPrintJop)>=0)
{

dcPrint.StartPage();

dcPrint.TextOut(2000,2000,"My small print jop");

dcPrint.EndPage();

dcPrint.EndDoc();
}

dcPrint.DeleteDC();
}

CDialog::OnOK();

}
0
Rejoignez-nous