L_DicomPrintSCUGetPrinterConfiguration

#include "ltdic.h"

L_LTDIC_API L_INT L_DicomPrintSCUGetPrinterConfiguration(hPrintSCU)

HDICOMPRINTSCU hPrintSCU; A handle to Dicom Print SCU

Parameter Description
hPrintSCU A handle to Dicom Print SCU

Returns

SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The function will not return until it receives the response of the Print SCP, or an error occurs. The function L_DicomPrintSCUGetLastOperationStatus can be used to obtain the status code specified in the response of the Print SCP. When the return value of the function GetPrinterConfiguration is 0, then the printer configuration information was retrieved successfully, with either a Success or Warning status code in the response of the Print SCP.

The retrieved printer configuration information is stored in the data member L_DicomPrintSCUGetPrinterConfiguration.

Required DLLs and Libraries

LTDIC
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64, Linux.

See Also

Functions: L_DicomPrintSCUGetPrinterConfiguration, L_DicomPrintSCUGetLastOperationStatus, L_DicomPrintSCUGetPrinterInfo
Topics: Print Management SCU

Example

L_INT DicomPrintSCUGetPrinterConfigurationExample(HDICOMPRINTSCU hPrintSCU) 
{ 
   L_INT nRet; 
   // Assume that the Association is already established 
 
   // Query the Print SCP for the printer configuration information 
   nRet = L_DicomPrintSCUGetPrinterConfiguration (hPrintSCU); 
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   else 
   { 
      // We will display only the Printer Name and Memory Bit Depth 
      // in the first Item 
 
      HDICOMDS       PrnConfig = L_DicomPrintSCUGetCurrentPrinterConfiguration(hPrintSCU); 
      pDICOMELEMENT  pElement;  
      L_TCHAR        szPrnConfigInfo[128];  
 
      pElement = L_DicomFindFirstElement (PrnConfig, NULL,  
                                            TAG_PRINTER_CONFIGURATION_SEQUENCE,  
                                            FALSE);  
 
      if (!pElement) 
         return -1; 
 
      pElement = L_DicomGetChildElement(PrnConfig, pElement, TRUE);  
      if (!pElement)  
         return -1; 
 
      pElement = L_DicomGetChildElement(PrnConfig, pElement, TRUE);  
      if (!pElement)  
         return -1; 
 
      wsprintf(szPrnConfigInfo, TEXT("Printer Name: ")); 
 
      pDICOMELEMENT pPrinterName;  
      pPrinterName = L_DicomFindFirstElement (PrnConfig, pElement,  
                                                TAG_PRINTER_NAME,  
                                                TRUE); 
 
      if (pPrinterName)  
      { 
         L_TCHAR* pszPrinterName = L_DicomGetStringValue(PrnConfig, pPrinterName, 0, 1);  
         if (pszPrinterName)  
         { 
            wsprintf(szPrnConfigInfo, TEXT("%s%s"), szPrnConfigInfo, pszPrinterName);  
         } 
      } 
 
      wsprintf(szPrnConfigInfo, TEXT("%s\nMemory Bit Depth: "), szPrnConfigInfo);  
 
      pDICOMELEMENT pMemoryBitDepth;  
      pMemoryBitDepth = L_DicomFindFirstElement (PrnConfig, pElement,  
                                                   TAG_MEMORY_BIT_DEPTH,  
                                                   TRUE);  
 
      if (pMemoryBitDepth)  
      { 
         L_INT16* pnMemoryBitDepth = L_DicomGetShortValue(PrnConfig, pMemoryBitDepth,  
                                                             0,  
                                                             1);  
         if (pnMemoryBitDepth)  
         { 
            wsprintf(szPrnConfigInfo, TEXT("%s%hu"), 
                     szPrnConfigInfo, *pnMemoryBitDepth);  
         } 
      } 
 
      MessageBox(NULL, szPrnConfigInfo, TEXT("Printer Config Info"), MB_OK);  
   } 
 
   return DICOM_SUCCESS; 
} 
Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help