DTWAIN_SetTempFileDirectoryEx

Top  Previous  Next

The DTWAIN_SetTempFileDirectoryEx sets the directory that will be used by DTWAIN when creating temporary files.

 

DTWAIN_BOOL  DTWAIN_SetTempFileDirectoryEx (

LPCTSTR

lpszDir,

LONG

CreationFlags );

 

 

Parameters

lpszDir

   Specifies the full path of the directory where DTWAIN will create temporary files.


CreationFlags

   Flags to indicate various aspects of the directory creation.  If no flags are to be applied, this value should be 0.


 

Return Values

If the function succeeds, TRUE is returned.  If unsuccessful, FALSE is returned.

 

Character specific version

ANSI version:

DTWAIN_SetTempFileDirectoryExA

Unicode version:

DTWAIN_SetTempFileDirectoryExW

 

Comments

DTWAIN_SetTempFileDirectoryEx specifies the directory, lpszDir, where DTWAIN will create temporary files.  These files are usually created by DTWAIN when creating multipage image files.  The files that are created are destroyed by DTWAIN when no longer necessary.


The CreationFlags are a set of boolean flags that can be applied to how the directory is created.  Currently, the only flag available is DTWAIN_TEMPDIR_CREATEDIRECTORY, which when specified, will create the directory if the directory does not already exist.


For example (C/C++ example), 


DTWAIN_SetTempFileDirectoryExA("c:\\SomeDirectory\\TempDir", DTWAIN_TEMPDIR_CREATEDIRECTORY);


will create the directory "c:\SomeDirectory\TempDir" if it does not already exist.  Without the DTWAIN_TEMPDIR_CREATEDIRECTORY flag, the directory must already exist for it to be set to the temporary file directory.


To get the current directory name, call DTWAIN_GetTempFileDirectory.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize