[TRY3] printer dialog fixes part1 + french

Detlef Riekenberg wine.dev at web.de
Tue Oct 11 08:42:51 CDT 2005


Am Dienstag, den 11.10.2005, 10:36 +0200 schrieb Jonathan Ernst:

-- cut --
+
+    EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &needed, &num);
+    if(num == 0)
+    {
+       
-- cut --

Sorry that didn't work.
You receive in "num" the Number of returned PRINTER_INFO_2 Entries in "buffer"
Since "buffer" is NULL, "num" is always 0.

Working Example from my Patch:
( http://www.winehq.org/pipermail/wine-patches/2005-October/021268.html )

+    /* Verify, that we have a Printer installed */
+    /* this will fail in wine, when you deleted your printer */
+
+    numentries = 0;
+    size = 0;
+    result = pEnumPrintersA(PRINTER_ENUM_LOCAL, 
+                            NULL, 2, NULL, 0, &size, &numentries);
+
+    if (size == 0)
+    {
+        result = pEnumPrintersA(PRINTER_ENUM_CONNECTIONS, 
+                                NULL, 2, NULL, 0, &size, &numentries);
+    }
+
-- cut --
size == 0: no Printer installed
size  > 0: one or more Printers installed


-- 
By By ...
      ... Detlef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EnumPrintersA.log
Type: text/x-log
Size: 1467 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20051011/32223897/EnumPrintersA.bin


More information about the wine-devel mailing list