News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

hello. Any examples on how to use printers

Started by xandaz, December 13, 2020, 07:54:07 AM

Previous topic - Next topic

xandaz

   I'm desperate to put my printer to work but haven't figured out how to do it. Does anyone have an example? Thanks

LiaoMi

Hi xandaz,

how to use printers from Siekmanski  :thumbsup:

xandaz


xandaz

   i have to say..it's kinda complex. but i'm looking into it. Thanks

LiaoMi


deeR44

Any printer that you buy comes with any driver programs and
instructions you need to print just about anything on it. Many
printer manufacturers call these instructions a "manual".

For a person who asks some very complicated questions, it's
hard for me to believe that you cannot do something as simple
as printing a document.


jj2007

Quote from: deeR44 on December 28, 2020, 07:34:06 PM
Any printer that you buy comes with any driver programs and
instructions you need to print just about anything on it. Many
printer manufacturers call these instructions a "manual".

For a person who asks some very complicated questions, it's
hard for me to believe that you cannot do something as simple
as printing a document.

Xandaz is trying to print a document programmatically, i.e. from Assembly. If you know how to do that, don't hesitate to post your source here.


TouEnMasm

sample

int BoiteDialogImprime()
{
    PRINTDLG pd;
    HWND hwnd = 0;

    // Initialize PRINTDLG
    ZeroMemory(&pd, sizeof(pd));
    pd.lStructSize = sizeof(pd);
    pd.hwndOwner = hwnd;
    pd.hDevMode = NULL;     // Don't forget to free or store hDevMode.
    pd.hDevNames = NULL;     // Don't forget to free or store hDevNames.
    pd.Flags = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC;
    pd.nCopies = 1;
    pd.nFromPage = 0xFFFF;
    pd.nToPage = 0xFFFF;
    pd.nMinPage = 1;
    pd.nMaxPage = 0xFFFF;

    if (PrintDlg(&pd) == TRUE)
    {
        // GDI calls to render output.

        // Delete DC when done.
        DeleteDC(pd.hDC);

    }
    return 0;
}

Fa is a musical note to play with CL