////////////////////////////////////////////////////////////////////// // PUT THE FOLLOWING DECLARATIONS IN THE HEADER FILE ////////////////////////////////////////////////////////////////////// HINSTANCE FFLibDllHandle; bool ( __stdcall *pfnFFAspiStart )( HWND ); int ( __stdcall *pfnFFGroupScan )( HWND, int, int, int, int, char*, char*, int, int, int, int ); void ( __stdcall *pfnFFAspiStop )( void ); ////////////////////////////////////////////////////////////////////// // SECTION ONE --- PRELIMINARY OPERATIONS ////////////////////////////////////////////////////////////////////// // load the DLL FFLibDllHandle = 0; FFLibDllHandle = LoadLibrary ( "FFLIB.DLL" ); if ( FFLibDllHandle == 0 ) { MessageBox ( NULL, "LoadLibrary:\nFFLIB.DLL not found.", "Error FS 001", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFAspiStart address pfnFFAspiStart = ( bool ( __stdcall *)( HWND ) ) GetProcAddress ( FFLibDllHandle, "FFAspiStart" ); if ( pfnFFAspiStart == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStart not found.", "Error FS 002", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // check ASPI support if ( pfnFFAspiStart ( Application -> Handle ) == false ) { MessageBox ( NULL, "No ASPI support.", "Error FS 005", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFAspiStop address pfnFFAspiStop = ( void ( __stdcall *)( void ) ) GetProcAddress ( FFLibDllHandle, "FFAspiStop" ); if ( pfnFFAspiStop == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStop not found.", "Error FS 004", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFGroupScan address pfnFFGroupScan = ( int ( __stdcall *)( HWND, int, int, int, int, char*, char*, int, int, int, int ) ) GetProcAddress ( FFLibDllHandle, "FFGroupScan" ); if ( pfnFFGroupScan == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFGroupScan not found.", "Error FS 003", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } ////////////////////////////////////////////////////////////////////// // SECTION TWO --- SCAN A GROUP OF PAGES ////////////////////////////////////////////////////////////////////// // prepare the parameters int scsi_ha = 0; int scsi_id = 6; int scsi_lun = 0; char comment [ 1024 ]; strcpy ( comment, "sample comment" ); char myPath [ 1024 ]; strcpy ( myPath, "C:\\LAVORI\\BCB" ); // put the sheets on the ADF and start scanning-view-memorize (all with a single call !) int TotalPages = pfnFFGroupScan ( Application -> Handle, 0, 1, 4, 0, myPath, comment, 128, scsi_ha, scsi_id, scsi_lun ); ////////////////////////////////////////////////////////////////////// // SECTION THREE --- FINAL OPERATIONS ////////////////////////////////////////////////////////////////////// // stop ASPI support pfnFFAspiStop ( ); // free the DLL if ( FFLibDllHandle != 0 ) FreeLibrary ( FFLibDllHandle );