DTWAIN_SelectSourceByNameWithOpen

Top  Previous  Next

The DTWAIN_SelectSourceByNameWithOpen function selects a TWAIN Source by specifying the Source's product name and optionally open the selected source.

 

DTWAIN_SOURCE DTWAIN_SelectSourceByNameWithOpen ( LPCTSTR szName, DTWAIN_BOOL bOpen );

 

Parameters

szName

Points to a null-terminated string containing the name of the TWAIN Source.


bOpen

    If TRUE, will open the selected source automatically.  If FALSE, the Source will be selected, but not openend..

 

Return Values

If successful, the return value is a non-zero DTWAIN_SOURCE handle to the selected Source.  Otherwise NULL is returned if a Source does not have the szName, of if there is an error selecting the Source.

 

Character specific version

ANSI version:

DTWAIN_SelectSourceByNameWithOpenA

Unicode version:

DTWAIN_SelectSourceByNameWithOpenW

 

Comments

The DTWAIN_SelectSourceByNameWithOpen function selects the TWAIN source that has the same product name as szName.  The product name is the same name that you will see in the TWAIN Select Source dialog's list box.  

 

The DTWAIN_SelectSourceByNameWithOpen works the same way as DTWAIN_SelectSourceByName, with the difference being that DTWAIN_SelectSourceByNameWithOpen() allows the application to control whether the selected source should be opened.  Opening a Source is a separate step from selecting the source, and opening a Source may take time with various TWAIN drivers.  Thus an application can skip the step of opening a Source if this is not desired.


If bOpen is FALSE, the application must explicitly call DTWAIN_OpenSource() to open the Source for capability negotiation and actual image acquisition.


Note that DTWAIN_SelectSourceByNameWithOpen() will override the settings that are made by DTWAIN_OpenSourcesOnSelect().


 

TWAIN State Transitions

Remains in State 3.

 

Prerequisite Calls

DTWAIN_SysInitialize

 

Optional Prerequisite Calls

None.

 

See Also

Source Selection Functions