L_DicomSetExtended

#include "ltdic.h"

L_LTDIC_API L_INT L_DicomSetExtended(hPDU, nID, pData, nLength)

Sets the extended data associated with the specified Presentation Context.

Parameters

HDICOMPDU hPDU

A DICOM Associate handle.

L_UCHAR nID

Presentation ID of the Presentation Context to which to set the extended data. The presentation ID provides information about both the class type of the data and the transfer syntax to use when transferring the data. It also identifies a specific Presentation Context within an Associate.

L_UCHAR *pData

Buffer that contains the data to set.

L_UINT32 nLength

Length of pData.

Returns

Value Meaning
DICOM_SUCCESS The function was successful.
>0 An error occurred. Refer to Return Codes.

Comments

To retrieve the length of the extended data associated with a Presentation Context, call L_DicomGetLengthExtended.

To get extended data associated with a Presentation Context, call L_DicomGetExtended.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

L_INT DicomSetExtendedExample(HDICOMPDU hPDU, L_UCHAR nID, HWND hWnd) 
{ 
   L_TCHAR szOut[2000]; 
   L_TCHAR szTemp[200]; 
   L_UCHAR Data[]={0,1,1,0,1}; 
   L_UCHAR *pData=NULL; 
   L_UINT32 lBytes, x; 
   L_INT nRet; 
 
   /* set 5 bytes of extended data for a particular Presentation */ 
   nRet = L_DicomSetExtended(hPDU, nID, (L_UCHAR *)Data, 5); 
   if (nRet != DICOM_SUCCESS) 
      return nRet; 
 
   /* get the data and display it */ 
   lBytes = L_DicomGetLengthExtended(hPDU, nID); 
   pData = L_DicomGetExtended(hPDU, nID); 
 
   lstrcpy(szOut, TEXT("Extended Data\n")); 
 
   for(x=0; x<lBytes; x++) 
   { 
      wsprintf(szTemp, TEXT("Byte #1: %d\n"), pData[x]); 
      lstrcat(szOut, szTemp); 
   } 
   MessageBox(hWnd, szOut, TEXT("Test"), MB_OK); 
   return DICOM_SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DICOM C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.