Ver Mensaje Individual
  #3
Antiguo 24 de agosto de 2022, 13:47
fastpho
El Foro es mi casa
Innovación: Por aportar innovaciones - Issue reason: SQLite + OO Cobol class Concurso: Primer puesto: Ganador/a del Primer puesto en un concurso - Issue reason: Acceso a datos Cobol vía web 
Última Actividad 21.08.2026 18:08
Posts Posts: 365
Likes enviados Enviados: 252
Likes recibidos Recibidos: 243

Hola @Kuk, estas son las llamadas , me parece que es mas una problema de libreria porque me toma bien otras funciones como OpenPrinterA, StartDocPrinterA ,StartPagePrinterA
EndPagePrinter,EndDocPrinter , ClosePrinter , EnumPrinters

Funcion : GetDefaultPrinter

link : GetDefaultPrinter function (Winspool.h) - Win32 apps | Microsoft Docs
Código COBOL:
  1.  ENVIRONMENT     DIVISION.
  2.  DATA            DIVISION.
  3.  WORKING-STORAGE SECTION.
  4. * C++
  5. * BOOL GetDefaultPrinter(
  6. *  _In_    LPTSTR  pszBuffer,
  7. *  _Inout_ LPDWORD pcchBuffer
  8. * );
  9.  01 pszBuffer                   PIC X(256).
  10.  01 pcchBuffer                  PIC 9(9) COMP-5 VALUE ZEROS.
  11. * Retorno de la funcion GetDefaultPrinter
  12.  01 Rt-Value-GET                PIC 9(4) COMP-5 VALUE ZEROS.  
  13.  PROCEDURE       DIVISION.
  14. *---------------------------------
  15.  GET-IMPRESOR.
  16.       MOVE 256 TO pcchBuffer.
  17.       CALL "GetDefaultPrinterA" WITH STDCALL
  18.             USING BY REFERENCE pszBuffer       *> pszBuffer Nombre del impresor default
  19.                   BY REFERENCE pcchBuffer      *> pcchBuffer Cantidad caracters del nombre
  20.             RETURNING Rt-Value-GET
  21.       END-CALL.
  22.       display "Rt-Value-GET: " , Rt-Value-GET      
Funcion SetDefaultPrinter
link : SetDefaultPrinter function (Winspool.h) - Win32 apps | Microsoft Docs
Código COBOL:
  1.  ENVIRONMENT     DIVISION.
  2.  DATA            DIVISION.
  3.  WORKING-STORAGE SECTION.
  4. * C++
  5. * BOOL SetDefaultPrinter(
  6. *      _In_ LPCTSTR pszPrinter
  7. *     );
  8. * Retorno de la funcion SetDefaultPrinter
  9.  01 Rt-Value-SET                PIC 9(4) COMP-5 VALUE ZEROS.  
  10.  01 PRINTERS-SELECCIONADA       PIC X(150).
  11. *
  12.  PROCEDURE       DIVISION.
  13.  INICIO.
  14. *---------------------------------
  15.  SETEO-IMPRESOR.
  16.           CALL "SetDefaultPrinterA"  WITH STDCALL  
  17.                USING BY REFERENCE    PRINTERS-SELECCIONADA
  18.                RETURNING Rt-Value-SET
  19.           END-CALL.
  20.           display " Rt-Value-SET :  " , Rt-Value-SET
  21. *-------------------------------------------
  22.      

Saludos ...
fastpho is offline   Responder Con Cita