This project has moved. For the latest updates, please go here.

Error in Win8 64bit.

Jul 15, 2014 at 4:18 AM
Edited Jul 15, 2014 at 4:23 AM
Hi Saraff,

Got an error and can't fix it when I am working in windows8 64bit. I built your samples in vs 2013 and all set to .net 4.5 for x64 bit. Run it fine, however scan documents it shows those error below. An image has been attached. Could you please let me know how to make it work? Thanks
Please see image here:

Jul 15, 2014 at 10:21 AM
Hello, xiaoyuewanli!
This error is caused by your actions. NullReferenceException was throw from the fact that the variable was not initialized _bmi (line 37). However, the method Marshal.PtrToStructure (IntPtr, Type) can not return null. See Marshal.PtrToStructure (IntPtr, Type)
Jul 16, 2014 at 12:23 AM
Edited Jul 16, 2014 at 12:27 AM
Hi Saraff,

Thanks for your reply. I run the sample 2 downloaded from this website without any change. It runs perfect under any os x86 or x64 in windows7.
When I check it step by step, I find _pBitmap is assigned to 0 in TwainDotNet line 833. Is it normal? It is not 0 if I test in x86. It only happens in Windows 8 64bit and built in x64. Any other ideas? Thanks

              IntPtr _pBitmap=_Memory.Lock(_hBitmap);
                try {
                    Image _img=null;
                    this._OnEndXfer(new EndXferEventArgs(_img));
                } finally {
                if(this._dsmEntry.DSPendingXfer(this._appid,this._srcds,TwDG.Control,TwDAT.PendingXfers,TwMSG.EndXfer,_pxfr)!=TwRC.Success) {
Jul 16, 2014 at 2:55 PM
Hello, xiaoyuewanli!
File TwainDotNet.cs not in my project. This file was a different name. You can see this link itself
Therefore, to update the project and see this topic
The variable _pBitmap should not be equal to 0. Otherwise, it indicates that the scanner has not returned image.
Jul 17, 2014 at 12:19 AM
Edited Jul 17, 2014 at 12:21 AM
Hi Saraff,

Got it. Thanks a lot. This error is not about DSM. I tried that topic.
I have a look and try to fix.