#include "ltdic.h"
L_LTDIC_API L_INT L_DicomPrintSCUGetPrinterConfiguration(hPrintSCU)
A handle to Dicom Print SCU
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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
Win32, x64, Linux.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document