GetScanConfigs Example for Visual Basic

Dim RasterTwain As New LEADRasterTwain_U
Dim nRet As Integer
Dim str As String

'Unlock Document support.
'Note that this is a sample key, which will not work in your toolkit.
RasterTwain.UnlockSupport L_SUPPORT_DOCUMENT, "TestKey"
RasterTwain.InitSession hWnd
RasterTwain.SelectSource

nRet = RasterTwain.GetScanConfigs(1, L_LTWAIN_BUFFER_MODE, 5)
If nRet = 0 Then
	MsgBox "GetScanConfigs method was successful."
	MsgBox "Scan Configuration count = " + CStr(RasterTwain.ScanConfigCount)

	str = "Transfer Mode = " + CStr(RasterTwain.ScanConfig(0).TransferMode) + Chr(13) + _
		"File Format = " + CStr(RasterTwain.ScanConfig(0).FileFormat) + Chr(13) + _
		"Buffer Size = " + CStr(RasterTwain.ScanConfig(0).BufferSize) + Chr(13) + _
		"Required Time = " + CStr(RasterTwain.ScanConfig(0).RequiredTime)

	MsgBox str, vbOKOnly, "Scan Configurations..."
Else
	MsgBox "Error occurred in the GetScanConfigs method!!!", vbOKOnly, "Error!!!"
End If