DTWAIN_SetTwainMode

Top  Previous  Next

The DTWAIN_SetTwainMode function sets the method in which DTWAIN will communicate with the TWAIN system during acquisitions.

 

DTWAIN_BOOL DTWAIN_SetTwainMode ( LONG TwainMode );

 

 

Parameters

TwainMode

Value identifying the TWAIN mode to use when communicating with a Source during acquisition of an image.

 

Return Values

The return value is TRUE if successful.  Otherwise FALSE is returned.

 

Comments

The DTWAIN_SetTwainMode function sets the method in which DTWAIN will communicate with TWAIN whenever an acquisition occurs, or when DTWAIN_ShowUIOnly is called.  Acquisitions occur during TWAIN States 6 and 7.  The values for TwainMode must be only one of the following:

 

Twain Mode

Value

Definition

DTWAIN_MODAL

1

Acquire using modal acquisition processing

DTWAIN_MODELESS

2

Acquire using modeless acquisition processing.

 

Briefly, the DTWAIN_MODAL processing is to be used by applications written in languages that cannot or do not want to adjust the application's message loop to accommodate TWAIN message handling.  The DTWAIN_MODELESS processing is to be used by application's written in a language that can (and do) adjust the application message loop.  Usually this includes C or C++ applications.

 

By default, DTWAIN is initialized for DTWAIN_MODAL processing.

 

Modeless and Modal acquisition processing is defined in detail in the topic Introduction to DTWAIN Acquisition Processing.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

See Also

DTWAIN_GetTwainMode, DTWAIN_ShowUIOnly