Highlighted
Absent Member.
Absent Member.
3428 views

[archive] Active-x for a scanning application

[Migrated content. Thread originally posted on 14 March 2003]

I would like to be able to interact with a scanner from an acucobol program using active-x, dll, etc. In short what I would like is have my program allow the scanning in of a document and then let the operator enter key words, location, file name so this information could be captured to a field and then later searched and retrieved and the document displayed to the screen via a call from another acucobol program. In summary, a simplied imaging application. I have an equipment management program and I would like to give the operator the opportunity to scan in repair work orders, etc and associate them with a given piece of equipment.
0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

We use the Desaware dwTwain control to allow our programs to interact with a scanner. You have to buy the Desaware ActiveX Gallimaufry tool set to get the control. You can check out their website, http://www.desaware.com for more info.

Jim
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Thanks for the tip, Do you call the active-x control from your AcuCobol program or use a VB program?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

We call the ActiveX control from our AcuCobol programs.
I think you can download a trial version of the control from the Desaware website and I think they have some sample VB programs that install with the trial version. When I was first attempting to use the control, I looked at their VB sample program and basically wrote an AcuCobol program that was identical to the sample. It's a pretty easy control to work with.

Jim
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

I know it's been awhile, but I am trying to used the twain active-x control from desaware you suggested. I am a novice at active-x and I was wondering if you would share some sample code of how you used the control, It would be greatly appreaciated,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Mike,

What kind of problems are you having with the control?
If you can post a sample program of what you have so far, I can take a look at it.

Jim
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Thanks for your reply. I downloaded the demo and used that in the adxfgen program. I only went as far with my program of putting the control on a screen and displaying it. When I do that I get the message.

This is a demo version
It can only be used in VB

I just wanted some reassurance it would work before I purchased, but if you have used it successfully I will go ahead and get it and proceed with my development. Then if I still have problems, I will forward you the code so and you can make suggestions, Thanks again,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

We use the control in our applications.
On your test, did you run the program from inside of AcuBench?
I think when we were first trying it out, when we ran our test program from inside AcuBench we got that VB message. But, if we ran the test program from the command line we didn't get the VB message. I know it doesn't make any sense, but I think that is what happened.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Actually, I don't use acubench. It was called from my main menu program. thanks,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

I purchased the Gallimufry twain control and when I tried it in a simple program I get the message:

"It worked", then my program aborts.

I suspect I need to do some sort of error code handling but I cannot seem to locate how to do this, Can you take a look at my actached code and give me some pointers,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Mike,

I couldn't find the "It worked" phrase in your code, so I'm not sure exactly where it is aborting.
Try the following code snippet for opening up the scanner and starting the aquire.


inquire twain-1 @ControlState in return-error.
if return-error
modify twain-1 @OpenAndSelectScanner(0)
end-if.
inquire twain-1 @ControlState in return-error.
if return-error = 0
display message box "No device selected." title "Acquire Stopped"
end-if
modify twain-1 @ScanImageWithUI().
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Active-x for a scanning application

Thanks for your help. The message is not in my code but coming from the active-x control itself. I found the message in the attached file from the sample program folder sent with the control. I think the control is written in VB so I assume it displays the same message. The vb demo program works ok on my machine. The odd thing is the message displayed indicates a successful action, however it aborts my program, not giving me a chance to test the return-code.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.