I'm desperate to put my printer to work but haven't figured out how to do it. Does anyone have an example? Thanks
Hi xandaz,
how to use printers from Siekmanski :thumbsup:
thanks Liao
i have to say..it's kinda complex. but i'm looking into it. Thanks
Hi,
maybe this example will be easier :icon_idea:
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.
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.
this one is enough to start:
https://docs.microsoft.com/en-us/windows/win32/dlgbox/print-dialog-box (https://docs.microsoft.com/en-us/windows/win32/dlgbox/print-dialog-box)
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;
}