Running DLL Twice

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Running DLL Twice

Post by kpassaur » Tue Jun 26, 2012 4:19 pm

I have a dll that I load and it runs. I end it with libfree naturally and when I go to run it again I get an error unless I exit from the script.

Below are the lines I use:

Let>twainsave_key=5B7EAE51-5A1E-C4E5-6016-NOTREALKEY21C3
Let>twainsave_key_start={
Let>twainsave_key_end=}
Let>twainsave_fullkey=twainsave_key_start
concat>twainsave_fullkey,twainsave_key
concat>twainsave_fullkey,twainsave_key_end

Let>command=-details "%scannersettingsdir%\details.txt"
LibLoad>%SYS_DIR%\twainsave.dll,hDll
LibFunc>hDll,TS_X,ret1,twainsave_fullkey
LibFunc>hDll,TS_Command,ret2,%command%
LibFree>hDll

Any ideas? Does it have to do with the buffer and if so how would I go about settting it?

Thanks

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jun 26, 2012 9:09 pm

What happens if you LibLoad> at the beginning of the script and LibFree> at the end of the script rather than loading and freeing multiple times?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Seems to work

Post by kpassaur » Wed Jun 27, 2012 9:37 am

I just did as you mentioned and it seems to work. Much better than my work around which was to disable the button once it was run.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts