DWORD DWFLAGS = Printer_enum_favorite | Printer_enum_local;
LPPRINTER_INFO_2 PPRINTERS;
DWORD CBPRINTERS;
DWORD CRETURNED, I;
Enumprinters (dwflags, null, 2, null, 0, & cbprinters, & creturned);
IF (! (pprinters = (lpprinter_info_2) Localalloc (LPTR, CBPrinters 4)))))))
Return False;
IF (! Enumprinters (dwflags, null, 2, (lpbyte) Pprinters,
Cbprinters, & Cbprinters, & Creturned)
{
LocalFree (Pprinters);
Return False;
}
IF (Creturned> 0)
{
For (i = 0; i { AfxMessageBox (Pprinters i) -> Pprintername); IF (strstr (Pprinters i) -> Pprintername, "PDF")! = 0 && Strstr ((Pprinters i) -> Pprintername, "Writer") <= 0) { m_snewprinter = "Adobe PDF"; Return True; } } For (i = 0; i { IF (strstr (Pprinters i) -> Pprintername, "Acrobat Distiller")! = 0 && m_snewprinter == "") { m_snewprinter = "acrobat distiller"; Return True; } } } LocalFree (Pprinters); Return False;