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

Saludos ...