Valid from List & Label 1
Some original Brother printer drivers seem to be not capable of issuing multiple print jobs on the same device context. This will lead to an LL_ERR_PRINTING error if the amount of pages leads to multiple jobs (see LL_PRNOPT_JOBPAGES) or when the project is printed the second time from the preview.Solution: Download the latest Brother drivers from http://solutions.brother.com or use alternative drivers, e.g.
HL1240 - HP LaserJet IIP
HL1250, HL1270N - HP LaserJet 4
Easily reproducable with the following (List & Label independent) code:
#include <windows.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
PRINTDLG pd = {0};
DOCINFO di = {0};
pd.lStructSize = sizeof(pd);
pd.Flags = PD_RETURNDC | PD_RETURNDEFAULT;
PrintDlg(&pd);
di.cbSize = sizeof(di);
di.lpszDocName = "test";
for (int i = 0; i < 2; ++i)
{
if (StartDoc(pd.hDC,&di) <= 0)
{
printf("error %25d, DC=%25x, err=%25x\n",i,pd.hDC,GetLastError());
break;
}
StartPage(pd.hDC);
Rectangle(pd.hDC,0,0,1000,1000);
EndPage(pd.hDC);
EndDoc(pd.hDC);
}
DeleteDC(pd.hDC);
return(0);
}
IDKBTE000620 KBTE000620