Home > Net >  Twain_32 closing times wrong connection
Twain_32 closing times wrong connection

Time:11-14

Steps:
1. Initialization
2. Open Source Marager TwRC rc=DSMparent (appid, IntPtr. Zero, TwDG. Control, TwDAT. Parent, TwMSG. OpenDSM, ref HWNDP);
3. Select the default scanner rc=DSMident (appid, IntPtr. Zero, TwDG. Control, TwDAT. Identity, TwMSG. GetDefault, SRCDS)
4. Open source rc=DSMident (appid, IntPtr. Zero, TwDG. Control, TwDAT. Identity, TwMSG. OpenDS, SRCDS);
5...
6. Close the source rc=DSMident (appid, IntPtr. Zero, TwDG. Control, TwDAT. Identity, TwMSG. CloseDS, SRCDS);
7. Close the Source Marager rc=DSMparent (appid, IntPtr. Zero, TwDG. Control, TwDAT. Parent, TwMSG. CloseDSM, ref HWND);

Is an error in step 6, "suggested trying to read or write protected memory, this usually indicates other memory has been damaged," and all the bosses look analysis analysis of the reason why

CodePudding user response:

Top up, can not be heavy

CodePudding user response:

Top up, can't sink ahhh

CodePudding user response:

Assess the results of rc
 
TwUserInterface guif=new TwUserInterface ();
Rc=DSuserif (appid, SRCDS, TwDG. Control, TwDAT UserInterface, TwMSG. DisableDS, guif);
If (rc==TwRC. Success)
{
Rc=DSMident (appid, IntPtr. Zero, TwDG. Control, TwDAT. Identity, TwMSG. CloseDS, SRCDS);
}

CodePudding user response:

Camera or scanner to reconnect, not line, you can restart it,

CodePudding user response:

Create an object, don't keep the new new object, the object, you new and closed,

CodePudding user response:

Unfortunately, when I use Java development,
Helpless,

CodePudding user response:

I share, Java version of the,
Hope useful to you,
https://blog.csdn.net/hanjun0612/article/details/99682621

CodePudding user response:

Calling unmanaged code need to pay attention to the GC, especially have a callback method calls, so one can experience the solution (not necessarily is a standard answer, but can solve the problem) that is callbacks and call static static rules are written, not because the GC to release this pointer to fly away,
  •  Tags:  
  • C#
  • Related