"Hwnd of Zero is not valid" Issue

A client of mine recently updated their menu and added another 2 categories to their menu list.
Updated prices and all was well. Till it recently started hanging and taking forever to get onto the POS menu screen.
I thought it may have something to do with information overload or something.

Then i made a back up of the current database and decided execute clear database transactions to start from scratch.
Over 1 year period the database reached 1.3gb!
when i executed that in SambaPOS it basically froze and crashed.

so i removed it manually from SQL management and that took a while but it still did it finally.

Went back into sambapos, and pressed POS and this is the message i get below

Restarted SambaPOS and went back to POS screen. Same issue.
Very strange! any ideas?

EDIT:
Log Below

[General Info]

Application: SambaPOS
Version:     5.1.61
Region:      en
DB:          SQ
Machine:     KAIPOS-PC
User:        KAIPOS
Date:        2/12/2017
Time:        4:45 PM

User Explanation:

KAIPOS said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.ComponentModel.Win32Exception
Message:     Invalid window handle
Source:      WindowsBase
Stack Trace: at MS.Win32.HwndWrapper.DestroyWindow(Object args)
   at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed)
   at MS.Win32.HwndWrapper.Dispose()
   at System.Windows.Interop.HwndSource.Dispose(Boolean disposing)
   at System.Windows.Interop.HwndSource.WeakEventDispatcherShutdown.OnShutdownFinished(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.Dispatcher.ShutdownImpl()
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
FastButton, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 480
--FreePhysicalMemory = 1455556
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-KAIPOS-PC
--Manufacturer = To be filled by O.E.M.
--Model = To be filled by O.E.M.
--TotalPhysicalMemory = 3661590528
--UserName = KAIPOS-PC\KAIPOS

-----------------------------


######################### E N D #########################

UPDATE1 I thought it had something to do with insufficient memory so I manage to free some more memory from PC, restarted PC and went back to POS, it hanged for a bit, then it suddenly started working again… As if it wasn’t cached and it started caching, went back and forth a few times and it was ok.
Went back to main menu, selected other things such as accounts, reports, tickets, work periods then press POS again, and it started to hang again… Checked Task manage and definitely still has enough memory to process so im stumped right now…

Can you PM me database? It does if for cleaned database too right?

Define cleaned? You mean a database without any transactions but with a menu and products or a fresh new database without anything like starting from scratch.

Before I send you the database I’m going to try removing all, and reinstalling it with latest samba too and see If it makes a difference.

As I installed the backed up database on a different system and ran sambapos and it POS screen came on without any delay or error. Tested it numerous times and worked fine. So my guess it’s got something to do with their main system.

I think it’s the same cause as I was getting here, but the error log is different

https://forum.sambapos.com/t/sambapos-5-1-61-beta/11464/465?u=markjw

I did notice the only time I was getting that error is if I use fast user switching. I also had a lot of tabs open in Chrome on the same system (I use a tab suspender plugin to free memory on inactive tabs) but it doesn’t appear to be related as I can leave SambaPOS open for all day while using the system, even locking it and going away, but if I leave the system and my wife signs in with her account (fast user switching) after a few hours if I go back to my account I got that error I mentioned on the linked post.

As I’ve explained on other topic both issues probably relates with graphic card driver. We have issues if graphic card software does not properly handle multi monitors, user switching or similar app window suspend / restore stuff. You can try -softrender switch. As it disable hardware rendering It may solve some issues.

1 Like