I have the following code:
- Code: Select all Expand view
#include "hbclass.ch"
#include "fivewin.ch"
#define PRINTER_ENUM_DEFAULT 1
#define PRINTER_ENUM_LOCAL 2
#define PRINTER_ENUM_CONNECTIONS 4
#define PRINTER_ENUM_FAVORITE 4
#define PRINTER_ENUM_NAME 8
#define PRINTER_ENUM_REMOTE 10
#define PRINTER_ENUM_SHARED 20
#define PRINTER_ENUM_NETWORK 40
FUNCTION Main()
LOCAL aPrinters, nNecesitados, nRetornados
TotPrinters(PRINTER_ENUM_NAME,NIL,1,@aPrinters,0,@nNecesitados,@nRetornados)
MsgInfo( aPrinters)
MsgInfo( nNecesitados)
MsgInfo( nRetornados)
Msginfo( Len(aPrinters), "Impresoras Encontradas")
MsgInfo( WinDefaultPrinter(), "Impresora por Defecto")
FOR n := 1 TO Len(aPrinters)
MsgInfo(aPrinters[n])
NEXT
RETURN NIL
DLL32 FUNCTION TotPrinters( Flags AS DWORD, Name AS LPSTR, Level AS DWORD, pPrinterEnum AS BYTE, cbBuf AS DWORD, pcbNeeded AS DWORD, pcReturned AS DWORD) ;
AS LONG PASCAL FROM "EnumPrinters" LIB "winspool.drv"
Unfortunately I was unable to get printers installed on my system via the DLL32 and if through a # pragma BEGINDUMP .... ENDDUMP using an assigned code on the Internet.
My need is that I have no idea of C++ and require begin development of an application for a center for Internet and the first thing I have to learn is to control printers when they receive work.
Variable aPrinters always returns NIL like the others.
Perhaps I can guide without having to use # pragma would appreciate it. I have used the SDK reference windows.
Many thanks in advance