[Migrated content. Thread originally posted on 07 August 2006]
I purchased an active-x control from Desaware called Gallimufry. I have used in succesfully in retrieving scanned images. However I have not been able to retrieve the name of the scanned file. It is supposed to be part of the data items supplied when the "ImageFileScanned" event is raised. I do not think I am doing the event control coding correctly. Everything else about this control is working great. Below is the relative code. Can someone help me?* code snippet for Acu Forum
* following items to recieve values from scan event
01 event-items.
03 image-name pic x(40).
03 number-of-images pic 9(3).
03 image-true pic 9.
SCREEN SECTION.
* active X control placed on screen
01 report-screen.
03 twain-1 TwainControl
size .1 line 22 col 80
USE-ALT, USE-RETURN, USE-TAB.
03 push-button title "&Acquire "
self-act exception-value = 37
SIZE 20 font small_font
line 5 col 5.
MAIN-logic.
display floating window lines 30 size 80
title "BRICS 2000 Document Imaging"
color black bckgrnd-white
with system menu
auto-resize
modeless
boxed
font is large-font
control font is large-font
handle in MAIN_window
cell size push-button font large-font.
display REPORT-SCREEN.
accept REPORT-SCREEN
evaluate true
when event_notified
evaluate event-type
when w-event
evaluate event-data-2
************************************************************ * from active-x documentation manual: *
Events
ImageFileScanned
Description
Raised when an image has been transferred successfully to disk when the DownloadToFiles property is True.
Syntax Event ImageFileScanned(Filename As String, ByVal PendingImages As Integer, cancelpending As Boolean)
Remarks The Filename parameter contains the name of the file that was saved. The PendingImages parameter contains the number of additional images that are ready to retrieve (if allowed by the current value of the MaxImagesToScan property). Further retrieval of images can be cancelled by setting the cancelpending parameter to True.
* *
* the code below is not entered, *
* What am I doing wrong in the event logic *
************************************************************
when @TwainControlImageFileScanned
call "c$geteventdata"
using
image-name
number-of-images
image-true
set exit_report_button_pushed to true
end-evaluate
end-evaluate
when start-scanning-button-pushed
*************************************************************
** when scan button clicked the following code works great *
** image is returned and written to the path given *
** however, the code above for getting the file name is not *
** accessed. *
*************************************************************
perform start-the-scan
end-evaluate
start-the-scan.
inquire twain-1 ControlState return-control-state.
modify twain-1 @Manufacturer (brics-name)
giving return-error.
modify twain-1 @ProductName (app-name)
giving return-error.
if return-control-state
modify twain-1 @DownLoadToFiles="true".
if return-control-state
modify twain-1
@DirectoryPath=document-path-name.
if return-control-state
modify twain-1 OpenAndSelectScanner ()
end-if.
inquire twain-1 ControlState return-control-state.
if return-control-state = 0
display message box "No Device Selected"
title "Acquire Stopped"
else
modify twain-1 ScanImageWithUI ().
**** as this point the file is transferred to disk, I would think control would
**** be passed to the event handling procedure
display message box "Scan Complete"
modify twain-1 CloseScanner ().



