L_DicomSetExtended

#include "ltdic.h"

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

HDICOMPDU hPDU;

/* a DICOM Associate handle */

L_UCHAR nID;

/* presentation ID */

L_UCHAR *pData;

/* extended data */

L_UINT32 nLength;

/* length of the extended data */

Sets the extended data associated with the specified Presentation Context.

Parameter

Description

hPDU

A DICOM Associate handle.

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.

pData

Buffer that contains the data to set.

nLength

Length of pData.

Returns

0

SUCCESS

>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

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

See Also

Functions:

L_DicomGetLengthExtended, L_DicomGetExtended

Topics:

Working with DICOM Associate Connections

Example

HWND hWnd;

L_VOID TestExtended(HDICOMPDU hPDU, L_UCHAR nID)
{
   L_CHAR szOut[2000];
   L_CHAR szTemp[200];
   L_UCHAR Data[]={0,1,1,0,1};
   L_UCHAR L_FAR *pData=NULL;
   L_UINT32 lBytes, x;

   /* set 5 bytes of extended data for a particular Presentation */
   L_DicomSetExtended(hPDU, nID, (L_UCHAR L_FAR*)Data, 5);

   /* get the data and display it */
   lBytes = L_DicomGetLengthExtended(hPDU, nID);
   pData = L_DicomGetExtended(hPDU, nID);

   lstrcpy(szOut, "Extended Data\n");

   for(x=0; x<lBytes; x++)
   {
      wsprintf(szTemp, "Byte #1: %d\n", pData[x]);
      lstrcat(szOut, szTemp);
   }
   MessageBox(hWnd, szOut, "Test", MB_OK);
}