IWiaDataTransfer::idtGetData method

The IWiaDataTransfer::idtGetData method retrieves complete files from a Windows Image Acquisition (WIA) device.

Syntax


HRESULT idtGetData(
  [in, out]     LPSTGMEDIUM pMedium,
  [in, unique]  IWiaDataCallback *pIWiaDataCallback
);

Parameters

pMedium [in, out]

Type: LPSTGMEDIUM

Pointer to the STGMEDIUM structure.

pIWiaDataCallback [in]

Type: IWiaDataCallback*

Pointer to the IWiaDataCallback interface.

Return value

Type: HRESULT

This method can return any one of the following values:

Return ValueMeaning
E_INVALIDARGOne or more parameters to this method contain invalid data.
E_OUTOFMEMORYThis method cannot allocate enough memory to complete its operation.
E_UNEXPECTEDAn unknown error occurred.
S_FALSEThe application canceled the operation.
S_OKThe image was successfully acquired.
STG_E_MEDIUMFULLThe storage medium the application is using to acquire the image is full.
WIA_S_NO_DEVICE_AVAILABLEThere are no WIA hardware devices attached to the user's computer.

 

This method will return a value specified in Error Codes, or a standard COM error if it fails for any reason other than those specified in the preceding table.

Remarks

In most respects, this method operates identically to the IDataObject::GetData method. The primary difference is that IWiaDataTransfer::idtGetData provides an additional parameter for a pointer to the IWiaDataCallback interface. Applications use this optional parameter to obtain status notifications during the data transfer. If no status notifications are needed, it should be set to zero.

The format of the data transfer is determined by the values of the item's WIA_IPA_FORMAT and WIA_IPA_TYMED properties. The application sets these properties with calls to the IWiaPropertyStorage::WriteMultiple method.

Unlike the IWiaDataTransfer::idtGetBandedData method, IWiaDataTransfer::idtGetData transfers a complete file from a WIA device to an application rather than just a single band of data. The pMedium parameter is a pointer to the STGMEDIUM structure which contains information on the storage medium to be used for the data transfer. Programs use the pIWiaDataCallback parameter to pass this method a pointer to the IWiaDataCallback interface. Periodically, this method will use the interface pointer to invoke the BandedDataCallback method and provide the application with status information about the data transfer in progress.

Pass NULL as the value of the lpszFileName member of the pMedium structure to allow WIA to determine the file name and location for the new file. Upon return, the lpszFileName member of the pMedium structure contains the location and name of the new file.

If the value returned by this method is a COM SUCCESS value or the transfer is a multipage file transfer, and the error code returned is WIA_ERROR_PAPER_JAM, WIA_ERROR_PAPER_EMPTY, or WIA_ERROR_PAPER_PROBLEM, WIA does not delete the file.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wia.h

Library

Wiaguid.lib

DLL

Wiaservc.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft