Loading...

Scanning works once, but fails the second time

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Scanning works once, but fails the second time

Postby NDFCU » Fri Apr 04, 2008 6:28 pm

I am an IT developer at Notre Dame Federal Credit Union in the US. We are considering the use of GDTwain on our Intranet, but I am having some issues getting it to work properly.

Although I can get the OCX to function properly the *first* time upon opening Internet Explorer, the OCX gives an error message the *second* time I try to run it.

In order to get it to work again, I have to close and reset Internet Explorer. It seems like there might be a memory leak of some sort. Perhaps you know what might be wrong.

Here is the debug error message:

End: OpenDefaultSource
RC: TWRC_FAILURE
CC: TWCC_MAXCONNECTIONS (DS is connected to max possible apps)
State: 3


Again, I can get to state 4 the first time, and the rest of the scan goes smoothly. But the second time, it gives me that error message.

Here is my source (vbscript):

Code: Select all
Set oTWAIN = CreateObject("gdtwain.twain")

   oTWAIN.SetLicenseNumber("XXXXXXXXXXXXXXXXXXXXXXX")

   oTWAIN.TwainOpenDefaultSource

   oTWAIN.TwainHasFeeder()
   oTWAIN.TWAINSetAutoFeed(TRUE)
   
   nImageID = oTWAIN.TwainAcquireToImageID
         
   If nImageID <> 0 Then
     oTWAIN.SaveAsPdf ("c:\gdtwaintest.pdf")
     oTWAIN.CloseImage (nImageID)
      MsgBox "Save c:\gdtwaintest.pdf completed"
   End If
   
   oTWAIN.TwainCloseSource
   oTWAIN.TwainUnloadSourceManager
   oTWAIN.TwainCloseSourceManager
NDFCU
 
Posts: 1
Joined: Fri Apr 04, 2008 5:52 pm

Re: Scanning works once, but fails the second time

Postby Loïc » Sun Apr 06, 2008 4:04 pm

Hi,

I think the oTWAIN object created should be released from the memory.


You can try to add this line at the end of your code to do that:

Code: Select all
Set oTWAIN = Nothing



If the problem has not gone away with this, please send me your web page for test at esupport (at) gdpicture (dot) com.

Best regards,

Loïc Carrère
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 2 guests